Example #1
0
    public void SetBattleEffect(NTGBattleUnitController.UnitStatus effect, bool inEffect)
    {
        if (animator == null)
        {
            return;
        }

        if (AnimationEffectClips.ContainsKey(effect) && AnimationEffectClips[effect] != null)
        {
            commonAoc["Common-Effect"] = AnimationEffectClips[effect];

            animator.runtimeAnimatorController = null;
            animator.runtimeAnimatorController = commonAoc;

            animator.SetBool("effect", inEffect);
        }
    }
    public void SetBattleEffect(NTGBattleUnitController.UnitStatus effect, bool inEffect)
    {
        if (animator == null)
        {
            return;
        }

        if (AnimationEffectClips.ContainsKey(effect) && AnimationEffectClips[effect] != null)
        {
            Debug.Log(effect.ToString() + "Setting to" + inEffect.ToString());

            aoc["Common-Effect"] = AnimationEffectClips[effect];

            animator.runtimeAnimatorController = null;
            animator.runtimeAnimatorController = aoc;

            animator.SetBool("effect", inEffect);
        }

        foreach (var ac in GetComponentsInChildren <NTGAnimatorController>())
        {
            ac.SetBattleEffect(effect, inEffect);
        }
    }