Exemple #1
0
    private IEnumerator WaitForAnimation(Poring poring, Poring targetPoring = null, Node targetNode = null)
    {
        // Magnum Break
        poring.Animator.Play(AnimationStateName);
        yield return(new WaitForSeconds(2));

        if (EffectOnSelf != null)
        {
            InstantiateParticleEffect.CreateFx(EffectOnSelf, poring.transform.position);
        }
        AOESkillActivate(poring, poring.Node, AOEValue);


        if (!MoveToTarget && gameMode.IsMineTurn())
        {
            TurnActiveUIController.Instance.SetActivePanel(true, poring.Node.TileProperty.Type);
        }
        else
        {
            TurnActiveUIController.Instance.NotMyTurn();
        }
    }
    private IEnumerator WaitForAnimation(Poring poring, float damage, Poring targetPoring = null, Node targetNode = null)
    {
        if (targetPoring != null)
        {
            // bash
            poring.transform.LookAt(targetPoring.gameObject.transform);
            poring.Animator.Play(AnimationStateName);
            yield return(new WaitForSeconds(2f));

            targetOnRoute.ForEach(p =>
            {
                if (p != targetPoring)
                {
                    if (EffectOnSelf != null)
                    {
                        InstantiateParticleEffect.CreateFx(EffectOnSelf, p.transform.position);
                    }

                    AddDamageToTarget(poring, p, damage);
                }
            });

            if (EffectOnSelf != null)
            {
                InstantiateParticleEffect.CreateFx(EffectOnSelf, targetPoring.transform.position);
            }

            AddDamageToTarget(poring, targetPoring, damage);
        }
        else if (targetNode != null)
        {
            // thunder bolt
            poring.transform.LookAt(targetNode.gameObject.transform);
            poring.Animator.Play(AnimationStateName);
            if (EffectOnSelf != null)
            {
                InstantiateParticleEffect.CreateFx(EffectOnSelf, poring.transform.position);
            }
            yield return(new WaitForSeconds(2f));

            if (EffectOnTarget != null)
            {
                InstantiateParticleEffect.CreateFx(EffectOnTarget, targetNode.transform.position);
            }

            AOESkillActivate(poring, targetNode, AOEValue, damage);
        }
        else
        {
            // Magnum Break
            poring.Animator.Play(AnimationStateName);
            yield return(new WaitForSeconds(2.5f));

            if (EffectOnSelf != null)
            {
                InstantiateParticleEffect.CreateFx(EffectOnSelf, poring.transform.position);
            }
            AOESkillActivate(poring, poring.Node, AOEValue, damage);
        }

        if (!MoveToTarget && gameMode.IsMineTurn())
        {
            TurnActiveUIController.Instance.SetActivePanel(true, poring.Node.TileProperty.Type);
        }
        else
        {
            TurnActiveUIController.Instance.NotMyTurn();
        }
        gameMode.CurrentGameState = nextState;
    }