public void AnimateMove(Vector3 endPos, bool forwards, int count) { for (int i = 0; i < count; i++) { GameObject newResource = TerrainManager.CreateResource(info); ResourceLerp lerper = newResource.AddComponent <ResourceLerp> (); if (forwards) { lerper.Init(gameObjects[0].transform.position, endPos, i); } else { gameObjects [gameObjects.Count - i - 1].GetComponentInChildren <Renderer> ().enabled = false; lerper.cb = RevealResource; lerper.Init(endPos, gameObjects[0].transform.position, i); } } }