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); } } }
private static object CloneScriptInstance(IPlayableBehaviour source) { UnityEngine.Object @object = source as UnityEngine.Object; bool flag = @object != null; object result; if (flag) { result = ScriptPlayable <T> .CloneScriptInstanceFromEngineObject(@object); } else { ICloneable cloneable = source as ICloneable; bool flag2 = cloneable != null; if (flag2) { result = ScriptPlayable <T> .CloneScriptInstanceFromIClonable(cloneable); } else { result = null; } } return(result); }
private static object CreateScriptInstance() { IPlayableBehaviour data = null; if (typeof(UnityEngine.ScriptableObject).IsAssignableFrom(typeof(T))) { data = ScriptableObject.CreateInstance(typeof(T)) as T; } else { data = new T(); } return(data); }
internal static bool HasScriptPlayable(this TimelineClip clip) { bool result; if (clip.asset == null) { result = false; } else { IPlayableBehaviour playableBehaviour = clip.asset as IPlayableBehaviour; result = (playableBehaviour != null || AnimatedParameterExtensions.GetScriptPlayableFields(clip.asset as IPlayableAsset).Any <FieldInfo>()); } return(result); }
internal static bool HasScriptPlayable(this TimelineClip clip) { if (clip.asset == null) { return(false); } IPlayableBehaviour scriptPlayable = clip.asset as IPlayableBehaviour; if (scriptPlayable != null) { return(true); } return(GetScriptPlayableFields(clip.asset as IPlayableAsset).Any()); }
private static object CloneScriptInstance(IPlayableBehaviour source) { UnityEngine.Object engineObject = source as UnityEngine.Object; if (engineObject != null) { return(CloneScriptInstanceFromEngineObject(engineObject)); } ICloneable cloneableObject = source as ICloneable; if (cloneableObject != null) { return(CloneScriptInstanceFromIClonable(cloneableObject)); } return(null); }
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); } } } }
public static int OnPlayableDestroy(IntPtr l) { int result; try { IPlayableBehaviour playableBehaviour = (IPlayableBehaviour)LuaObject.checkSelf(l); Playable playable; LuaObject.checkValueType <Playable>(l, 2, out playable); playableBehaviour.OnPlayableDestroy(playable); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public static int PrepareFrame(IntPtr l) { int result; try { IPlayableBehaviour playableBehaviour = (IPlayableBehaviour)LuaObject.checkSelf(l); Playable playable; LuaObject.checkValueType <Playable>(l, 2, out playable); FrameData info; LuaObject.checkValueType <FrameData>(l, 3, out info); playableBehaviour.PrepareFrame(playable, info); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
private static object CloneScriptInstance(IPlayableBehaviour source) { Object @object = source as Object; object result; if (@object != null) { result = ScriptPlayable <T> .CloneScriptInstanceFromEngineObject(@object); } else { ICloneable cloneable = source as ICloneable; if (cloneable != null) { result = ScriptPlayable <T> .CloneScriptInstanceFromIClonable(cloneable); } else { result = null; } } return(result); }