void GenerateLightBulbs() { for (int y = 0; y < numRows; ++y) { for (int x = 0; x < numColumns; ++x) { LightBulb newLight = ((GameObject)Instantiate(Bulbs, topLeft + new Vector3(offset * x, offset * y, 0), Quaternion.identity)).GetComponent <LightBulb>(); newLight.Init(new Vector2(x, y)); Debug.Log(newLight.mPosition); mModels[y, x] = newLight; mBulbStates[y, x] = new Light(); } } }