public void BindAnimatorController(AnimatorController animatorController)
        {
            if (_curAnimatorController != null)
            {
                _curAnimatorController.On_ActionStateEnter -= HandleOn_ActionStateEnter;
                _curAnimatorController.On_AnimatorEvent    -= HandleOn_AnimatorEvent;
                _curAnimatorController.Dispose();
            }
            _curAnimatorController = animatorController;
            UpdateNameHashActionMap();
            _curAnimatorController.On_ActionStateEnter += HandleOn_ActionStateEnter;
            _curAnimatorController.On_AnimatorEvent    += HandleOn_AnimatorEvent;
            //强制做默认动作
            ActionData actionData = _gameObjectActionData.GetActionData(_gameObjectActionData.defaultId);

            _curAnimatorController.animator.Play(actionData.animName, actionData.animLayer);
            GOAction defaultAction = GetAction(_gameObjectActionData.defaultId);

            ReallyDoAction(defaultAction);
        }
Beispiel #2
0
 public GOAction(GameObjectController gameObjectController, ActionData actionData, bool isNet = false)
 {
     _controller     = gameObjectController;
     this.actionData = actionData;
     Init(isNet);
 }