Пример #1
0
        public void AddObjectProperties(Object obj, AnimationClip clip)
        {
            if (obj == null || clip == null)
            {
                return;
            }

            IPlayableAsset     asset    = obj as IPlayableAsset;
            IPlayableBehaviour playable = obj as IPlayableBehaviour;

            // special case for assets that contain animated script playables.
            // The paths in the clip start from the field with the templated playable
            if (asset != null)
            {
                if (playable == null)
                {
                    AddSerializedPlayableModifications(asset, clip);
                }
                else
                {
                    // in this case the asset is the playable. The clip applies directly
                    AnimationMode.InitializePropertyModificationForObject(obj, clip);
                }
            }
        }
 public void AddObjectProperties(Object obj, AnimationClip clip)
 {
     if (!(obj == null) && !(clip == null))
     {
         IPlayableAsset     playableAsset     = obj as IPlayableAsset;
         IPlayableBehaviour playableBehaviour = obj as IPlayableBehaviour;
         if (playableAsset != null)
         {
             if (playableBehaviour == null)
             {
                 this.AddSerializedPlayableModifications(playableAsset, clip);
             }
             else
             {
                 AnimationMode.InitializePropertyModificationForObject(obj, clip);
             }
         }
     }
 }