Exemplo n.º 1
0
        public void PlayDetectionAnimation()
        {
            FloorMechanismAnimator animator = m_animator;

            if (!(null == animator) && animator.TryGetDetectionAnimationName(out string animName))
            {
                PlayTimeline("detection", animName, restart: false);
                m_animationCallback.Setup(animName, restart: false);
                animator.SetAnimation(animName, animLoops: false);
            }
        }
Exemplo n.º 2
0
        public IEnumerator WaitForActivationEnd()
        {
            FloorMechanismAnimator animator = m_animator;

            if (!(null == animator))
            {
                string activationAnimationName = animator.animationName;
                while (!CharacterObjectUtility.HasAnimationEnded(animator, activationAnimationName))
                {
                    yield return(null);
                }
            }
        }
Exemplo n.º 3
0
        public IEnumerator ActivatedByOpponent()
        {
            FloorMechanismAnimator animator = m_animator;

            if (!(null == animator) && animator.TryGetOpponentActivationAnimationName(out string activationAnimationName))
            {
                PlayTimeline("opponent_activation", activationAnimationName, restart: false);
                m_animationCallback.Setup(activationAnimationName, restart: false);
                animator.SetAnimation(activationAnimationName, animLoops: false, async: false);
                do
                {
                    yield return(null);
                }while (!CharacterObjectUtility.HasAnimationReachedLabel(animator, activationAnimationName, "shot"));
            }
        }
Exemplo n.º 4
0
        protected override IEnumerator SetAnimatorDefinition()
        {
            GameObject prefab = m_characterData.prefab;

            if (null == prefab)
            {
                Log.Error("AnimatedFloorMechanismData named '" + m_characterData.get_name() + " has no prefab set.", 169, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FloorMechanismObject.cs");
                yield break;
            }
            m_instance = Object.Instantiate <GameObject>(prefab, this.get_transform().get_position(), m_direction.GetRotation(), this.get_transform());
            m_animator = m_instance.GetComponent <FloorMechanismAnimator>();
            if (null == m_animator)
            {
                Log.Error("Floor mechanism prefab named '" + prefab.get_name() + "' is missing a FloorMechanismAnimator component.", 178, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FloorMechanismObject.cs");
            }
            InitializeAnimator();
        }