예제 #1
0
 protected override void Start()
 {
     if (m_dataBinder != null)
     {
         setButtonState(m_dataBinder.GetCurrentData(), true); // Initilize widget value
     }
     else
     {
         setButtonState(false, true);
     }
 }
예제 #2
0
        // Stop listening to any previous data binder and start listening to the new one.
        public void RegisterDataBinder(LMWidgets.DataBinder <LMWidgets.ButtonToggleBase, bool> dataBinder)
        {
            if (dataBinder == null)
            {
                return;
            }

            UnregisterDataBinder();
            m_dataBinder = dataBinder as DataBinderToggle;
            setButtonState(m_dataBinder.GetCurrentData());
        }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     if (m_ToggleController != null)
     {
         m_ToggleController.DataChangedHandler += OnToggleChanged;
         bool currentBool = m_ToggleController.GetCurrentData();
         if (currentBool == true)
         {
             iconImage.texture = OnTexture;
         }
         else
         {
             iconImage.texture = OffTexture;
         }
     }
 }