void Awake() { vab = gameObject.AddComponent <VAButton>(); vab.r_downable = MR.SR(TouchArea); vab.doClamp = true; vab.doNormalize = false; vab.label = ""; }
void Update() { if (Input.GetMouseButtonDown(0)) { Rect r = MR.SR(0.00f, 0.00f, 0.30f, 0.20f); Vector3 pos = Input.mousePosition; pos.y = Screen.height - pos.y; if (r.Contains(pos)) { DoEscape(); } } if (Input.GetKeyDown(KeyCode.Escape)) { DoEscape(); } }
void OnGUI() { if (showHeights) { int across = depths.GetLength(0); int down = depths.GetLength(1); int W = Screen.width; int H = Screen.height; int W2 = (int)(H * aspect); int X = (Screen.width - W2) / 2; X = 0; W2 = W; GUI.DrawTexture(new Rect(X, 0, W2, H), tex); GUI.color = ((Time.time % 1.0f) < 0.5f) ? Color.black : Color.white; for (int j = 0; j < down; j++) { for (int i = 0; i < across; i++) { int x = (W2 * i) / across; int y = (H * j) / down; int w = W / across; int h = W / down; GUI.Label( new Rect(X + x, y, w, h), depths[i, j].ToString(), OurStyles.LABELLJ(10)); } } } else { GUI.Label(MR.SR(0, 0, 0.5f, 0.1f), "Press H to show heights", OurStyles.LABELULX(14)); } }
void OnGUI() { Rect r = MR.SR(0.498f, 0.00f, 0.004f, 1.00f); GUI.DrawTexture(r, LAZY.t2d_white32x32); }