Exemple #1
0
        private void StartScriptableAnim(ScriptableAnimationStateWrapper state, PlayMode mode)
        {
            if (_scriptableAnims == null)
            {
                _scriptableAnims = new ScriptableAnimCollection(this);
            }

            if (mode == PlayMode.StopAll)
            {
                _scriptableAnims.Clear();
            }
            else
            {
                _scriptableAnims.Remove(state.Layer);
            }

            _scriptableAnims.Add(state);
        }
Exemple #2
0
        internal static ISPAnim CreateScriptableAnimState(SPAnimationController controller, IScriptableAnimationClip clip)
        {
            if (controller == null)
            {
                throw new System.ArgumentNullException("controller");
            }
            if (clip == null)
            {
                throw new System.ArgumentNullException("clip");
            }

            var st = clip.GetState(controller);

            if (st == null)
            {
                return(SPAnim.Null);
            }

            var state = new ScriptableAnimationStateWrapper();

            state.Init(controller, st);
            return(state);
        }