// void FixedUpdate() // { // // } public void changeColorOfBlocks() { if (isStart) { myColor = new Color(255f / 255f, 215f / 255f, 0f / 255f); for (int i = 0; i < childBlocks.Count; i++) { Block child = childBlocks[i]; ColorPallete.getInstance().setDollarBlockTex(child.gameObject.GetComponent <Renderer>()); //child.GetComponent<Block>().changeColor(myColor); } } else { int levelNum = PlayerPrefs.GetInt(GameConstants.CURRENT_LEVEL, 1); myColor = ColorPallete.getInstance().getColor(levelNum); myTexture = ColorPallete.getInstance().getTetxure(levelNum); // myColor = ColorPallete.getInstance().getColor(levelNum); for (int i = 0; i < childBlocks.Count; i++) { Block child = childBlocks[i]; ColorPallete.getInstance().changeColorOrTex(child.gameObject.GetComponent <Renderer>(), levelNum, myColor); // child.GetComponent<Block>().changeColor(myColor); } } }