Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ChangeColor(){
- foreach (Renderer render in GetComponentsInChildren<Renderer>()) {
- if (colorSwitch >= 0 && colorSwitch <=2) {
- render.material.color = color [0];
- }
- }
- foreach (Renderer render in GetComponentsInChildren<Renderer>()) {
- if (colorSwitch >= 2 && colorSwitch <=4) {
- render.material.color = color [1];
- }
- }
- foreach (Renderer render in GetComponentsInChildren<Renderer>()) {
- if (colorSwitch >= 6) {
- render.material.color = color [2];
- red = true;
- CancelInvoke ("ChangeColor");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement