private void DrawPart(CutPart part) { GUILayout.Space(10); GUIScripts.GuiLine(3); GUILayout.Space(5); part.partTitle = GUIScripts.TextField(part.partTitle, "Part Title Here (Blank Fills Automatically)"); GUILayout.Space(5); GUIScripts.GuiLine(1); GUILayout.Space(5); part.DrawInspectorPart(scene.GetArrayElementAtIndex(index), null, cutscene); }
public override void OnInspectorGUI() { serializedObject.Update(); list.DoLayoutList(); EditorStyles.textField.wordWrap = true; GUIStyle fontStyle = new GUIStyle(GUI.skin.button); fontStyle.alignment = TextAnchor.MiddleLeft; if (cutscene != null) { if (cutscene.parts == null) { cutscene.parts = new List <CutPart>(); } if (cutscene.parts.Count > 0) { index = list.index; if (index < cutscene.parts.Count && index >= 0) { GUILayout.Space(-10); GUILayout.BeginHorizontal(); if (GUILayout.Button("New Part")) { AddPart(index + 1); } createCutType = (CutPartType)EditorGUILayout.EnumPopup(createCutType); GUILayout.EndHorizontal(); GUILayout.Space(3); GUILayout.BeginHorizontal(); if (GUILayout.Button("Duplicate")) { DuplicatePart(index); } if (GUILayout.Button("Delete")) { DeletePart(index); } GUILayout.EndHorizontal(); //Draw Part Starts Here if (index < cutscene.parts.Count) { DrawPart(cutscene.parts[index]); } } else { GUILayout.Space(-10); GUILayout.BeginHorizontal(); if (GUILayout.Button("New Part")) { AddPart(index + 1); } createCutType = (CutPartType)EditorGUILayout.EnumPopup(createCutType); GUILayout.EndHorizontal(); GUILayout.Space(10); } } else { GUILayout.Space(-10); GUILayout.BeginHorizontal(); if (GUILayout.Button("New Part")) { AddPart(index + 1); } createCutType = (CutPartType)EditorGUILayout.EnumPopup(createCutType); GUILayout.EndHorizontal(); GUILayout.Space(10); } GUILayout.Space(5); GUIScripts.GuiLine(3); GUILayout.Space(5); EditorGUILayout.LabelField("--- Cutscene Settings", EditorStyles.boldLabel); cutscene.stopsBattle = EditorGUILayout.Toggle("Cutscene Stops Battle: ", cutscene.stopsBattle); GUILayout.Space(20); serializedObject.ApplyModifiedProperties(); //selectedPart = GUILayout.SelectionGrid(selectedPart, partNames.ToArray(), 1, fontStyle); if (GUI.changed) { if (index >= 0 && index < cutscene.parts.Count) { cutscene.parts[index].GetTitle(); } EditorUtility.SetDirty(cutscene); //EditorSceneManager.MarkSceneDirty(cutscene.gameObject.scene); } } }