Mercurial > hg > Game > Games
comparison Orchestland/Assets/LeapMotion/Widgets/Scripts/DemoScripts/ButtonDemoGraphics.cs @ 1:f7675884f2a1
Add Orchestland project
author | Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2015 23:09:20 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:347d21cdfc22 | 1:f7675884f2a1 |
---|---|
1 using UnityEngine; | |
2 using UnityEngine.UI; | |
3 using System.Collections; | |
4 | |
5 | |
6 public class ButtonDemoGraphics : MonoBehaviour | |
7 { | |
8 public void SetActive(bool status) | |
9 { | |
10 Renderer[] renderers = GetComponentsInChildren<Renderer>(); | |
11 Text[] texts = GetComponentsInChildren<Text>(); | |
12 Image[] GUIimages = GetComponentsInChildren<Image>(); | |
13 foreach (Renderer renderer in renderers) | |
14 { | |
15 renderer.enabled = status; | |
16 } | |
17 foreach(Text text in texts){ | |
18 text.enabled = status; | |
19 } | |
20 foreach(Image image in GUIimages){ | |
21 image.enabled = status; | |
22 } | |
23 | |
24 } | |
25 | |
26 public void SetColor(Color color) | |
27 { | |
28 Renderer[] renderers = GetComponentsInChildren<Renderer>(); | |
29 Text[] texts = GetComponentsInChildren<Text>(); | |
30 Image[] GUIimages = GetComponentsInChildren<Image>(); | |
31 foreach (Renderer renderer in renderers) | |
32 { | |
33 renderer.material.color = color; | |
34 } | |
35 foreach (Text text in texts){ | |
36 text.color = color; | |
37 } | |
38 foreach(Image image in GUIimages){ | |
39 image.color = color; | |
40 } | |
41 } | |
42 } |