Tanoda
pb_PanelToggle.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.UI;
3using System.Collections;
4
5namespace GILES.Interface
6{
11 {
13 public GameObject panel;
14
15 private Color onColor = new Color(1f, .68f, 55f/255f, 1f),
16 offColor = new Color(.26f, .26f, .26f, 1f);
17
18 protected override void Start()
19 {
20 base.Start();
21
22 onColor = selectable.colors.normalColor;
23 offColor = selectable.colors.disabledColor;
24 }
25
26 public void DoToggle()
27 {
28 panel.SetActive(!panel.activeInHierarchy);
29
30 ColorBlock block = selectable.colors;
31 block.normalColor = panel.activeInHierarchy ? onColor : offColor;
32 selectable.colors = block;
33 }
34 }
35}
UnityEngine.Color Color
Definition: TestScript.cs:32
GameObject panel
The panel to enable / disable with this toggle.