void Start() {
StartTest = StartCoroutine(TestCheck());
}
IEnumerator TestCheck()
{
while(true)
{
float[] StartSide = new float[(int)Abc.transform.localScale.x];//массив координат начал сторон
float[] EndSide = new float[(int)Abc.transform.localScale.x];//массив координат концов сторон
if(stoped == false)
{
for(int i = 0; i <= (Abc.transform.localScale.x - 1);i++)
{
print("Граница [" + i + "]стороны = [" + (Abc.transform.position.x - (Abc.transform.localScale.x/2 - 1 * i)) + ";" + (Abc.transform.position.x - (Abc.transform.localScale.x/2 - ((1 * i) + 1)) + "]"));
StartSide[i] = Abc.transform.position.x - (Abc.transform.localScale.x/2 - 1 * i);
EndSide[i] = Abc.transform.position.x - (Abc.transform.localScale.x/2 - ((1 * i) + 1));
if(i == (Abc.transform.localScale.x - 1f)) stoped = true;
}
}else
{
for(int a = 0; a <= (Abc.transform.localScale.x - 1);a++)
{
print("Else - " + StartSide[a]);
if(a == (Abc.transform.localScale.x - 1f)) StopCoroutine(StartTest);
}
}
yield return new WaitForSeconds(1f);
}
}