public override void OnInspectorGUI() { DrawDefaultInspector(); SE_SkillControl myScript = (SE_SkillControl)target; if (GUILayout.Button("Open Editor")) { SE_SkillEditorWindow window = EditorWindow.GetWindow(typeof(SE_SkillEditorWindow), false) as SE_SkillEditorWindow; window.SetTarget(myScript); } if (GUILayout.Button("Restart All Emitters")) { myScript.RestartAllEmitters(); } var centeredStyle = new GUIStyle(EditorStyles.boldLabel); centeredStyle.alignment = TextAnchor.UpperCenter; GUILayout.Label("Save Load", centeredStyle); if (GUILayout.Button("Save To Asset File")) { SE_SkillUtils.SaveSkillControlToScriptableObject(myScript); } if (GUILayout.Button("Load Asset File")) { SE_SkillUtils.LoadSkillControlFromScriptableObject(myScript); } }
static void CreateViews() { if (curWindow != null) { curWindow.workView = new SE_WorkView(); curWindow.workView.viewSkin = curWindow.editorSetting.ViewGUISkin; curWindow.propertyView = new SE_SkillPropertyView(); curWindow.propertyView.viewSkin = curWindow.editorSetting.ViewGUISkin; curWindow.propertyView.inspectorSkin = curWindow.editorSetting.InspectorGUISkin; } else { curWindow = EditorWindow.GetWindow <SE_SkillEditorWindow>(); } }
public static void InitNodeEditor() { SE_SkillEditorWindow.InitEditorWindow(); }
public static void InitEditorWindow() { curWindow = (SE_SkillEditorWindow)EditorWindow.GetWindow <SE_SkillEditorWindow>(); curWindow.titleContent = new GUIContent("Skill Editor"); CreateViews(); }