Tanoda
pb_StageManagerButton.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using GILES;
4using UnityEngine;
5using UnityEngine.UI;
6
8{
9#if DANA
10 private readonly Color onColor = new Color(1f, 1f, 1f, 1f),
11 offColor = new Color(1f, 1f, 1f, 0.2f);
12#elif UNITY_WEBGL
13
14 private readonly Color onColor = new Color(57 / 255f, 190 / 255f, 187 / 255f, 1f),
15 offColor = new Color(1f, 1f, 1f, 1f);
16#else
17 private readonly Color onColor = new Color(0.2235294f, 0.6352941f, 0.8941177f, 1f),
18 offColor = new Color(.0f, .0f, .0f, 1f);
19#endif
20
21 public CanvasGroup window;
22 public bool isOn = false;
23
24 public void ToggleWindow()
25 {
26 ColorBlock block = selectable.colors;
27 block.normalColor = !isOn ? onColor : offColor;
28 selectable.colors = block;
29
30 window.alpha = isOn ? 0 : 1;
31 window.blocksRaycasts = !isOn;
32 window.interactable = !isOn;
33 isOn = !isOn;
34 window.transform.SetAsLastSibling();
35 }
36}
UnityEngine.Color Color
Definition: TestScript.cs:32