Permalink
Browse files

inlined cube instantiation, added additional comments.

  • Loading branch information...
GandhiGames committed Sep 26, 2016
1 parent 9edd13a commit a256ca9afbf300631ab8ba8b89e9026ad67202b6
Showing with 2 additions and 3 deletions.
  1. +2 −3 Assets/Scripts/_Demo Scene Scripts/Controllers/ShapeController.cs
@@ -54,11 +54,9 @@ protected void OnSelected(GameEvent e)
protected void Spawn()
{
GameObject cube = null;
try
{
cube = ObjectPool.instance.GetObject(this.name);
GameObject cube = ObjectPool.instance.GetObject(this.name);
cube.transform.position = new Vector3(transform.position.x + Random.Range(-1f, 1f),
transform.position.y,
transform.position.z + Random.Range(-1f, 1f));
@@ -70,6 +68,7 @@ protected void Spawn()
}
catch (PrefabNotFoundException e)
{
// Object not contained in pool.
Debug.Log(e.Message);
}
}

0 comments on commit a256ca9

Please sign in to comment.