Ejemplo n.º 1
0
 public void RecedeAnimator()
 {
     player.animator.runtimeAnimatorController = anim;
     director.ClearGenericBinding(this.gameObject);
     animator.runtimeAnimatorController = null;
     animator.runtimeAnimatorController = anim;
 }
Ejemplo n.º 2
0
        private void UpdatePlayableBindingsIfRequired(PlayableAsset playableAsset, PlayableDirector director)
        {
            m_SynchedPlayableBindings = new PlayableBinding[0];

            if (playableAsset != null)
            {
                var bindings = playableAsset.outputs;
                m_SynchedPlayableBindings = bindings.ToArray();
            }

            foreach (var binding in m_SynchedPlayableBindings)
            {
                // don't add bindings without a specific target type, clear previously bound objects
                // This can happen with timeline tracks that do not have a specific binding.
                if (binding.outputTargetType == null)
                {
                    director.ClearGenericBinding(binding.sourceObject);
                }
                else if (!director.HasGenericBinding(binding.sourceObject))
                {
                    director.SetGenericBinding(binding.sourceObject, null);
                }
            }

            serializedObject.Update();
        }
Ejemplo n.º 3
0
 //根据track名删除其绑定的对象
 public void ClearGenericBinding(string key)
 {
     qPlayableDirector.ClearGenericBinding(bindingDict[key].sourceObject);
 }