PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/Scripts/controlInstruction.js

http://acid-and-base.googlecode.com/
JavaScript | 51 lines | 36 code | 6 blank | 9 comment | 5 complexity | 13d744695652c43ddb2d329e285cfbd3 MD5 | raw file
 1var showGUI = true;
 2var showScale = false;
 3var canShowScale = false;
 4var scale : Texture2D;
 5
 6function Update () {
 7	if (Input.GetKeyDown(KeyCode.Escape))
 8	{
 9		if(showGUI){
10			showGUI = false;
11			}
12		else{
13			showGUI = true;
14		}
15		if(showScale){
16			showScale = false;
17			}
18		else{
19			showScale = true;
20		}
21	}
22}
23
24function OnGUI()
25{
26	if (showGUI)
27	{
28		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");
29	}
30	
31	/*
32	var pha = GameObject.Find("Acid").GetComponent("Properties").ph;
33	var phb = GameObject.Find("Base").GetComponent("Properties").ph;
34	GUI.Box(Rect(Screen.width - 100,0,100,40),"");
35	GUI.Label(Rect(Screen.width - 100,0,100,20),"Acid = "+pha);
36	GUI.Label(Rect(Screen.width - 100,20,100,20),"Base = "+phb);
37	*/
38	
39	if (showScale)
40	{
41	var pha = GameObject.Find("Acid").GetComponent("Properties").ph;
42	var phb = GameObject.Find("Base").GetComponent("Properties").ph;
43	
44	GUI.Label(Rect(Screen.width - scale.width,0,scale.width, scale.height), scale);
45	GUI.Label(Rect(Screen.width - scale.width + 32*pha - 13, 12, 10, 20),"A");
46	GUI.Label(Rect(Screen.width - scale.width + 32*phb - 14, 32, 10, 20), "B");
47	}
48	//GUI.Label(Rect(Screen.width - 100,200,100,20),"Acid = "+pha);
49	//GUI.Label(Rect(Screen.width - 100,220,100,20),"Base = "+phb);
50	
51}