Mercurial > hg > Game > Games
comparison Orchestland/Assets/LeapMotion+OVR/Widgets/Scripts/DataBinderExamples/ToggleToTextDataBinder.cs @ 1:f7675884f2a1
Add Orchestland project
author | Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2015 23:09:20 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:347d21cdfc22 | 1:f7675884f2a1 |
---|---|
1 using UnityEngine; | |
2 using UnityEngine.UI; | |
3 using System.Collections; | |
4 using LMWidgets; | |
5 | |
6 public class ToggleToTextDataBinder : DataBinderToggle { | |
7 [SerializeField] | |
8 Text uiText; | |
9 | |
10 override public bool GetCurrentData() { | |
11 if ( uiText.text.ToLower() == "true" ) { | |
12 return true; | |
13 } | |
14 else { | |
15 return false; | |
16 } | |
17 } | |
18 | |
19 override protected void setDataModel(bool value) { | |
20 if ( value == true ) { | |
21 uiText.text = "True"; | |
22 } | |
23 else { | |
24 uiText.text = "False"; | |
25 } | |
26 } | |
27 } |