/Scripts/controlInstruction.js
http://acid-and-base.googlecode.com/ · JavaScript · 51 lines · 36 code · 6 blank · 9 comment · 5 complexity · 13d744695652c43ddb2d329e285cfbd3 MD5 · raw file
- var showGUI = true;
- var showScale = false;
- var canShowScale = false;
- var scale : Texture2D;
- function Update () {
- if (Input.GetKeyDown(KeyCode.Escape))
- {
- if(showGUI){
- showGUI = false;
- }
- else{
- showGUI = true;
- }
- if(showScale){
- showScale = false;
- }
- else{
- showScale = true;
- }
- }
- }
- function OnGUI()
- {
- if (showGUI)
- {
- GUI.Box(Rect(0,0,300,90), "W,A,S,D - Move\nQ - Switch Character\nE - Interact/Pickup & Drop Item\nLeft Mouse Button - Camera Control\nESC - Pause\n");
- }
-
- /*
- var pha = GameObject.Find("Acid").GetComponent("Properties").ph;
- var phb = GameObject.Find("Base").GetComponent("Properties").ph;
- GUI.Box(Rect(Screen.width - 100,0,100,40),"");
- GUI.Label(Rect(Screen.width - 100,0,100,20),"Acid = "+pha);
- GUI.Label(Rect(Screen.width - 100,20,100,20),"Base = "+phb);
- */
-
- if (showScale)
- {
- var pha = GameObject.Find("Acid").GetComponent("Properties").ph;
- var phb = GameObject.Find("Base").GetComponent("Properties").ph;
-
- GUI.Label(Rect(Screen.width - scale.width,0,scale.width, scale.height), scale);
- GUI.Label(Rect(Screen.width - scale.width + 32*pha - 13, 12, 10, 20),"A");
- GUI.Label(Rect(Screen.width - scale.width + 32*phb - 14, 32, 10, 20), "B");
- }
- //GUI.Label(Rect(Screen.width - 100,200,100,20),"Acid = "+pha);
- //GUI.Label(Rect(Screen.width - 100,220,100,20),"Base = "+phb);
-
- }