public void Awake()
 {
     //此处填写Awake逻辑
     m_AnimationComponent           = this.Entity.GetComponent <AnimationComponent>();
     m_StackFsmComponent            = this.Entity.GetComponent <StackFsmComponent>();
     m_MouseTargetSelectorComponent = Game.Scene.GetComponent <MouseTargetSelectorComponent>();
     m_UserInputComponent           = Game.Scene.GetComponent <UserInputComponent>();
 }
Exemplo n.º 2
0
        public override void OnFinished()
        {
            AnimationComponent animationComponent = this.GetBuffTarget().GetComponent <AnimationComponent>();

            foreach (var animMapInfo in m_ReplacedAnimData)
            {
                animationComponent.RuntimeAnimationClips[animMapInfo.Key] = animMapInfo.Value;
            }

            animationComponent.PlayAnimByStackFsmCurrent();
            m_ReplacedAnimData.Clear();
        }
Exemplo n.º 3
0
        public override void OnExecute()
        {
            ReplaceAnimBuffData replaceAnimBuffData = this.BuffData as ReplaceAnimBuffData;
            AnimationComponent  animationComponent  = this.GetBuffTarget().GetComponent <AnimationComponent>();

            foreach (var animMapInfo in replaceAnimBuffData.AnimReplaceInfo)
            {
                this.m_ReplacedAnimData[animMapInfo.StateType] = animationComponent.RuntimeAnimationClips[animMapInfo.StateType];
                animationComponent.RuntimeAnimationClips[animMapInfo.StateType] = animMapInfo.AnimName;
            }
            animationComponent.PlayAnimByStackFsmCurrent();

            this.BuffState = BuffState.Running;
        }
        public override void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }
            base.Dispose();

            //此处填写释放逻辑,但涉及Entity的操作,请放在Destroy中
            m_UserInputComponent = null;
            m_StackFsmComponent  = null;
            m_AnimationComponent = null;
            this.CancellationTokenSource?.Dispose();
            this.CancellationTokenSource = null;
        }