Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
/******************************************************************************
* Copyright (C) Leap Motion, Inc. 2011-2018. *
* Leap Motion proprietary and confidential. *
* *
* Use subject to the terms of the Leap Motion SDK Agreement available at *
* https://developer.leapmotion.com/sdk_agreement, or another agreement *
* between Leap Motion and you, your company or other organization. *
******************************************************************************/
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace Leap.Unity.InputModule {
public class ToggleToggler : MonoBehaviour {
public Text text;
public UnityEngine.UI.Image image;
public Color OnColor;
public Color OffColor;
public void SetToggle(Toggle toggle) {
if (toggle.isOn) {
text.text = "On";
text.color = Color.white;
image.color = OnColor;
} else {
text.text = "Off";
text.color = new Color(0.3f, 0.3f, 0.3f);
image.color = OffColor;
}
}
}
}
f6b8e5137This file is pinned to the selected release. Download the original to open it in your design tool.