// Use this for initialization void Start() { gMO = GameObject.Find("GameManager"); gM = gMO.GetComponent<GameManager>(); colorArray = new Color[]{ tetrahedronColor, octahedronColor, dodecahedronColor, icosahedronColor, icosahedronColor}; for(int i = 0; i < transform.childCount; i++) { childScript = transform.GetChild(i).gameObject.GetComponent<BossChooseShape>(); childScript.ChangeShape(i, colorArray[i]); } }
// Use this for initialization void Start() { gMO = GameObject.Find("GameManager"); gM = gMO.GetComponent <GameManager>(); colorArray = new Color[] { tetrahedronColor, octahedronColor, dodecahedronColor, icosahedronColor, icosahedronColor }; for (int i = 0; i < transform.childCount; i++) { childScript = transform.GetChild(i).gameObject.GetComponent <BossChooseShape>(); childScript.ChangeShape(i, colorArray[i]); } }