Tanoda
ToggleToggler.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using UnityEngine;
10using UnityEngine.UI;
11using System.Collections;
12
13namespace Leap.Unity.InputModule {
14 public class ToggleToggler : MonoBehaviour {
15 public Text text;
16 public UnityEngine.UI.Image image;
17 public Color OnColor;
19
20 public void SetToggle(Toggle toggle) {
21 if (toggle.isOn) {
22 text.text = "On";
23 text.color = Color.white;
24 image.color = OnColor;
25 } else {
26 text.text = "Off";
27 text.color = new Color(0.3f, 0.3f, 0.3f);
28 image.color = OffColor;
29 }
30 }
31 }
32}
UnityEngine.Color Color
Definition: TestScript.cs:32