Exemplo n.º 1
0
        /// <summary>
        /// <para>Using another set of animations to override current set.</para>
        /// _setName should be one in the AnimDict,
        /// otherwise we assume there's no available set of anims to switch
        /// </summary>
        /// <param name="_setName"></param>
        public void OverrideWith(string _setName, bool _isForce = false)
        {
            // Stop if clips haven't been initialized
            // or we didn't have the animSet in AnimDict
            if (m_clipOverrides == null ||
                AnimDict.ContainsKey(_setName) == false)
            {
                return;
            }

            AnimatorStateInfo currentInfo = RealAnimator.GetCurrentAnimatorStateInfo(0);

            if (_isForce)
            {
                // LATER: Can we find a more elegant way or the native function to do this?
                foreach (KeyValuePair <AnimationClip, AnimationClip> pair in m_clipOverrides)
                {
                    m_clipOverrides[pair.Key.name] = null;
                }
            }
            AnimSet targetSet = AnimDict[_setName];

            foreach (string clipName in targetSet.Keys)
            {
                m_clipOverrides[clipName] = targetSet[clipName];
            }
            OverrideController.ApplyOverrides(m_clipOverrides);

            RealAnimator.Play(currentInfo.shortNameHash, 0, currentInfo.normalizedTime);
            CurrentSetName = _setName;
        }
Exemplo n.º 2
0
 public BaseCustomGUI()
 {
     Overrides = new OverrideController();
     Ignores   = new ElementController();
     Disabled  = new ElementController();
 }
Exemplo n.º 3
0
 public BaseCustomGUI()
 {
     Overrides = new OverrideController();
     Ignores   = new IgnoreController();
 }