Ejemplo n.º 1
0
 void OnActionEvent()
 {
     if (_callback != null)
     {
         AnimationCallBack cb  = _callback;
         object            arg = _arg;
         _callback = null;
         _arg      = null;
         cb(arg);
     }
 }
Ejemplo n.º 2
0
 public void PlayImmediate(AnimationID id, AnimationCallBack callback, object arg, AnimationEndEventCallBack endEventCallBack, object endEventArg)
 {
     //      //if (!gameObject.activeInHierarchy) return;
     //_callback = callback;
     //_arg = arg;
     //      _endEventCallBack = endEventCallBack;
     //      _endEventArg = endEventArg;
     ////_stateHash = Animator.StringToHash(_id2Name[(int)id]);
     //      if (_animator != null) {
     //    _animator.SetInteger(kAnimatorStateParam, (int)id);
     //          _animator.CrossFade(_id2Name[(int)id], 0);
     //      }
 }
Ejemplo n.º 3
0
 public void Play(AnimationID id, AnimationCallBack callback = null, object arg = null, AnimationEndEventCallBack endEventCallBack = null, object endEventArg = null)
 {
     //if (!gameObject.activeInHierarchy) return;
     _callback         = callback;
     _endEventCallBack = endEventCallBack;
     _endEventArg      = endEventArg;
     //_stateHash = Animator.StringToHash(_id2Name[(int)id]);
     _arg = arg;
     if (_animator != null)
     {
         //_animator.SetInteger(kAnimatorStateParam, (int)id);
         _animator.Play(id.ToString());
     }
 }