/// <summary> /// Update and Draw the inspector /// </summary> public override void OnInspectorGUI() { visualTrack.Update(); EditorGUILayout.Foldout(shotFoldout, "Shot List"); ShotTrack track = base.serializedObject.targetObject as ShotTrack; { var __array1 = track.TimelineItems; var __arrayLength1 = __array1.Length; for (int __i1 = 0; __i1 < __arrayLength1; ++__i1) { var shot = (CinemaShot)__array1[__i1]; { shot.name = EditorGUILayout.TextField(new GUIContent("Shot Name"), shot.name); EditorGUI.indentLevel++; shot.shotCamera = EditorGUILayout.ObjectField(new GUIContent("Camera"), shot.shotCamera, typeof(Camera), true) as Camera; shot.CutTime = EditorGUILayout.FloatField(new GUIContent("Cut Time"), shot.CutTime); shot.ShotLength = EditorGUILayout.FloatField(new GUIContent("Shot Length"), shot.ShotLength); EditorGUI.indentLevel--; } } } if (GUILayout.Button("Add New Shot")) { CutsceneItemFactory.CreateNewShot(track); } visualTrack.ApplyModifiedProperties(); }
/// <summary> /// Update and Draw the inspector /// </summary> public override void OnInspectorGUI() { visualTrack.Update(); EditorGUILayout.Foldout(shotFoldout, "Shot List"); ShotTrack track = base.serializedObject.targetObject as ShotTrack; TimelineItem[] items = track.TimelineItems; for (int i = 0; i < items.Length; i++) { CinemaGlobalAction shot = items[i] as CinemaGlobalAction; shot.name = EditorGUILayout.TextField(new GUIContent("Shot Name"), shot.name); EditorGUI.indentLevel++; // Check if it is an actor event. CinemaShot cinemaShot = shot as CinemaShot; if (cinemaShot != null) { cinemaShot.shotCamera = EditorGUILayout.ObjectField(new GUIContent("Camera"), cinemaShot.shotCamera, typeof(Camera), true) as Camera; } else { // Display something for non-default shots } shot.Firetime = EditorGUILayout.FloatField(new GUIContent("Cut Time"), shot.Firetime); shot.Duration = EditorGUILayout.FloatField(new GUIContent("Shot Length"), shot.Duration); EditorGUI.indentLevel--; } if (GUILayout.Button("Add New Shot")) { CutsceneItemFactory.CreateNewShot(track); } visualTrack.ApplyModifiedProperties(); }
/// <summary> /// Update and Draw the inspector /// </summary> public override void OnInspectorGUI() { visualTrack.Update(); EditorGUILayout.Foldout(shotFoldout, "Shot List"); ShotTrack track = base.serializedObject.targetObject as ShotTrack; foreach (CinemaShot shot in track.Shots) { shot.name = EditorGUILayout.TextField(new GUIContent("Shot Name"), shot.name); EditorGUI.indentLevel++; shot.shotCamera = EditorGUILayout.ObjectField(new GUIContent("Camera"), shot.shotCamera, typeof(Camera), true) as Camera; shot.CutTime = EditorGUILayout.FloatField(new GUIContent("Cut Time"), shot.CutTime); shot.ShotLength = EditorGUILayout.FloatField(new GUIContent("Shot Length"), shot.ShotLength); EditorGUI.indentLevel--; } if (GUILayout.Button("Add New Shot")) { CutsceneItemFactory.CreateNewShot(track); } visualTrack.ApplyModifiedProperties(); }
private void addNewShot(ShotTrack shotTrack) { GameObject shot = CutsceneItemFactory.CreateNewShot(shotTrack).gameObject; Undo.RegisterCreatedObjectUndo(shot, string.Format("Create {0}", shot.name)); }