Esempio n. 1
0
        public IEnumerator PlayRangedActionAnimation(Direction directionToAttack)
        {
            if (!m_characterData.hasRangedAttackAnimations)
            {
                yield return(PlayActionAnimation(directionToAttack, waitForAnimationEndOnMissingLabel: true));

                yield break;
            }
            CharacterAnimationInfo rangedAttackAnimationInfo = new CharacterAnimationInfo(Vector2Int.op_Implicit(m_cellObject.coords), "rangedattack", "rangedattack", loops: false, directionToAttack, m_mapRotation);

            StartFightAnimation(rangedAttackAnimationInfo, (Action)((CharacterObject)this).PlayIdleAnimation, (Action)null, restart: true, async: false);
            Animator2D animator = m_animator2D;
            int        num      = default(int);

            if (animator.CurrentAnimationHasLabel("shot", ref num))
            {
                while (!CharacterObjectUtility.HasAnimationReachedLabel(animator, rangedAttackAnimationInfo, "shot"))
                {
                    yield return(null);
                }
            }
            else
            {
                Log.Warning(animator.GetDefinition().get_name() + " is missing the 'shot' label in the animation named '" + rangedAttackAnimationInfo.animationName + "'.", 512, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\FightCharacterObject.cs");
            }
        }
        public IEnumerator PlayHitAnimation()
        {
            CharacterAnimationInfo hitAnimationInfo = new CharacterAnimationInfo(Vector2Int.op_Implicit(m_cellObject.coords), "hit", "hit", loops: false, direction, m_mapRotation);

            StartFightAnimation(hitAnimationInfo, (Action)((CharacterObject)this).PlayIdleAnimation, (Action)null, restart: true, async: false);
            Animator2D animator = m_animator2D;

            while (!CharacterObjectUtility.HasAnimationReachedLabel(animator, hitAnimationInfo, "die"))
            {
                yield return(null);
            }
        }
Esempio 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"));
            }
        }
        public IEnumerator PlayActivationAnimation()
        {
            Animator2D animator = m_animator2D;

            if (!m_characterData.hasActivationAnimation)
            {
                Log.Warning(animator.GetDefinition().get_name() + " does not have an activation animation.", 204, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\ObjectMechanismObject.cs");
                yield break;
            }
            CharacterAnimationInfo activationAnimationInfo = new CharacterAnimationInfo(Vector2Int.op_Implicit(m_cellObject.coords), "attack", "attack", loops: false, direction, m_mapRotation);

            StartFightAnimation(activationAnimationInfo, (Action)((CharacterObject)this).PlayIdleAnimation, (Action)null, restart: true, async: false);
            while (!CharacterObjectUtility.HasAnimationReachedLabel(animator, activationAnimationInfo, "shot"))
            {
                yield return(null);
            }
            TriggerActivationEffect();
        }
        protected override IEnumerator PlayDeathAnimation()
        {
            CharacterAnimationInfo deathAnimationInfo = new CharacterAnimationInfo(Vector2Int.op_Implicit(m_cellObject.coords), "hit", "death", loops: false, direction, m_mapRotation);

            StartFightAnimation(deathAnimationInfo, null, null, restart: false);
            Animator2D animator = m_animator2D;
            int        num      = default(int);

            if (animator.CurrentAnimationHasLabel("die", ref num))
            {
                while (!CharacterObjectUtility.HasAnimationReachedLabel(animator, deathAnimationInfo, "die"))
                {
                    yield return(null);
                }
                animator.set_paused(true);
            }
            else
            {
                Log.Warning(animator.GetDefinition().get_name() + " is missing the 'die' label in the animation named '" + deathAnimationInfo.animationName + "'.", 244, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\BoardCharacterObject.cs");
            }
        }