3 using System.Collections;
7 public Sprite ToolIcon;
9 public Sprite iconLeftControllerLeft;
10 public Sprite iconLeftControllerRight;
11 public Sprite iconLeftControllerUp;
12 public Sprite iconLeftControllerDown;
13 public Sprite iconRightControllerLeft;
14 public Sprite iconRightControllerRight;
15 public Sprite iconRightControllerUp;
16 public Sprite iconRightControllerDown;
21 WhenNoPatientIsLoaded,
25 public ToolDisplayTime displayTime = ToolDisplayTime.WhenPatientIsLoaded;
32 Material mat =
new Material(Shader.Find(
"Custom/TextShader"));
35 texts = GetComponentsInChildren( typeof(Text),
true );
39 foreach (Text t
in texts)
43 Material material =
new Material(Shader.Find(
"Custom/UIObject"));
44 material.renderQueue += 2;
46 images = GetComponentsInChildren( typeof(Image),
true );
50 foreach (Image i
in images)
52 if( i.material.name ==
"Default UI Material")
53 i.material = material;
58 public void OnEnable()
61 Invoke (
"MoveToUIAnchor",0.0001f);
63 InputDeviceManager.instance.setLeftControllerTouchpadIcons (
64 iconLeftControllerLeft, iconLeftControllerRight, iconLeftControllerUp, iconLeftControllerDown);
66 InputDeviceManager.instance.setRightControllerTouchpadIcons (
67 iconRightControllerLeft, iconRightControllerRight, iconRightControllerUp, iconRightControllerDown);
70 public void OnDisable()
73 Invoke (
"MoveBackToToolControl",0.0001f);
76 private void MoveToUIAnchor()
79 transform.SetParent (ToolUIAnchor.instance.transform,
false);
81 private void MoveBackToToolControl()
83 transform.SetParent (ToolControl.instance.transform,
false);