private void SetEffect(CharacterCondition characterCondition)
    {
        string path = string.Format("Animators/Effect/{0}", characterCondition.ToString());
        RuntimeAnimatorController animController = Resources.Load <RuntimeAnimatorController>(path);

        if (animator != null && animController != null)
        {
            animator.runtimeAnimatorController = animController;
        }
    }
예제 #2
0
    private void ChangeEffectsAnimation(CharacterCondition polluteType)
    {
        string path = string.Format("Animators/Effect/{0}", polluteType.ToString());
        RuntimeAnimatorController animController = Resources.Load <RuntimeAnimatorController>(path);

        if (effectList == null)
        {
            return;
        }
        for (int i = 0; i < effectList.Count; i++)
        {
            if (effectList[i] != null)
            {
                effectList[i].runtimeAnimatorController = animController;
            }
        }
    }