Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public void ChangeColor(){
  2. foreach (Renderer render in GetComponentsInChildren<Renderer>()) {
  3. if (colorSwitch >= 0 && colorSwitch <=2) {
  4. render.material.color = color [0];
  5. }
  6. }
  7. foreach (Renderer render in GetComponentsInChildren<Renderer>()) {
  8. if (colorSwitch >= 2 && colorSwitch <=4) {
  9. render.material.color = color [1];
  10. }
  11. }
  12. foreach (Renderer render in GetComponentsInChildren<Renderer>()) {
  13. if (colorSwitch >= 6) {
  14. render.material.color = color [2];
  15. red = true;
  16. CancelInvoke ("ChangeColor");
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement