///Remove an ActionClip from this Track public void DeleteAction(ActionClip action) { UnityEditor.Undo.RegisterCompleteObjectUndo(this, "Remove Action"); actions.Remove(action); if (ReferenceEquals(CutsceneUtility.selectedObject, action)) { CutsceneUtility.selectedObject = null; } UnityEditor.Undo.DestroyObjectImmediate(action); root.Validate(); }
///Pastes the object's values from editor prefs json public static void PasteClipValues(ActionClip clip) { var json = EditorPrefs.GetString("Slate_CopyDirectableValuesJSON"); var wasStartTime = clip.startTime; var wasEndTime = clip.endTime; var wasBlendIn = clip.blendIn; var wasBlendOut = clip.blendOut; JsonUtility.FromJsonOverwrite(json, clip); clip.startTime = wasStartTime; clip.endTime = wasEndTime; clip.blendIn = wasBlendIn; clip.blendOut = wasBlendOut; }
///Cut a clip public static void CutClip(ActionClip clip) { copyJson = JsonUtility.ToJson(clip, false); copyType = clip.GetType(); (clip.parent as CutsceneTrack).DeleteAction(clip); }
///Copy a clip public static void CopyClip(ActionClip clip) { copyJson = JsonUtility.ToJson(clip, false); copyType = clip.GetType(); }
///Copies the object's values to editor prefs json public static void CopyClipValues(ActionClip clip) { var json = JsonUtility.ToJson(clip); EditorPrefs.SetString("Slate_CopyDirectableValuesJSON", json); }
public static void CutClip(ActionClip action) { copyJson = JsonUtility.ToJson(action, false); copyType = action.GetType(); (action.parent as CutsceneTrack).DeleteAction(action); }
public static void CopyClip(ActionClip action) { copyJson = JsonUtility.ToJson(action, false); copyType = action.GetType(); }