Beispiel #1
0
 protected virtual void OnDisable()
 {
     StopAllCoroutines();
     if (_isOver)
     {
         DoRollOut(true);
     }
     if (_isPressed)
     {
         DoRelease(false, true);
     }
     if (_unclickTween != null && _unclickTween.IsPlaying())
     {
         _unclickTween.Complete();
     }
     if (_tooltip != null)
     {
         _tooltip.SetActive(false);
     }
     HOtk2dGUIManager.RemoveButton(this);
     // Remove from eventual toggle group
     if (_toggleGroupid != "")
     {
         List <HOtk2dButton> bts = _TogglesByGroupId[_toggleGroupid];
         bts.RemoveAt(bts.IndexOf(this));
         if (bts.Count <= 0)
         {
             _TogglesByGroupId.Remove(_toggleGroupid);
         }
     }
 }
Beispiel #2
0
        // ===================================================================================
        // UNITY METHODS ---------------------------------------------------------------------

        protected virtual void OnEnable()
        {
            HOtk2dGUIManager.AddButton(this);
            // Add to eventual toggle group
            if (_isToggle && _toggleGroupid != "")
            {
                if (_toggleGroupid == "")
                {
                    return;
                }
                if (!_TogglesByGroupId.ContainsKey(_toggleGroupid))
                {
                    _TogglesByGroupId.Add(_toggleGroupid, new List <HOtk2dButton>());
                }
                _TogglesByGroupId[_toggleGroupid].Add(this);
            }
        }
Beispiel #3
0
 void ChangeCamera(Camera cam)
 {
     _guiCamera = cam;
     HOtk2dGUIManager.RemoveButton(this);
     HOtk2dGUIManager.AddButton(this);
 }