Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C# by Raiden ( 6 years ago )
IEnumerator MoveBlocksDown()
{
BoxCollider2D[] bColliders = levelPoolParent.GetComponentsInChildren<BoxCollider2D>();
float t = 0f;
float speed = 3f;
while (t < 1f)
{
t += Time.deltaTime * speed;
// Moves the object to target position
for (int i = 0; i < bColliders.Length; i++)
{
float newYPos = bColliders[i].transform.position.y - 0.985f;
if (bColliders[i].transform.position.y > newYPos)
{
bColliders[i].transform.position = Vector3.Lerp(bColliders[i].transform.position, new Vector3(0f, newYPos, 0f), t);
}
}
Debug.Log("T = " + t);
yield return null;
}
}
Revise this Paste