Exemple #1
0
        public void SetState(string key, bool value)
        {
            if (!value && AnimationStates.Contains(key))
            {
                AnimationStates = AnimationStates.Where(each => each != key).ToArray();
            }
            else if (value && !AnimationStates.Contains(key))
            {
                AnimationStates = AnimationStates.Add(key);
            }

            GetAnimator().SetBool(key, value);
        }
Exemple #2
0
        public void SetState(string key, float value)
        {
            if (value == 0 && AnimationStates.Contains(key))
            {
                AnimationStates = AnimationStates.Where(each => each != key).ToArray();
            }
            else if (value != 0 && !AnimationStates.Contains(key))
            {
                AnimationStates = AnimationStates.Add(key);
            }

            GetAnimator().SetFloat(key, value);
        }