void Setup(int right, int down) { init = false; if (right > 0) { GameObject o = Instantiate(this.gameObject, transform.position + new Vector3(1f, 0f, 0f), Quaternion.identity) as GameObject; nextRight = o.GetComponent <Fog>(); nextRight.Setup(right - 1, down); } if (down > 0) { GameObject o = Instantiate(this.gameObject, transform.position + new Vector3(0f, -1f, 0f), Quaternion.identity) as GameObject; nextDown = o.GetComponent <Fog>(); nextDown.Setup(0, down - 1); } }