public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.HelpBox("This file stores references to the ink files in your project and performs other tasks. It is a core part of the Ink Integration package.\nDeleting this file will cause a new instance of it to be created in the project root.", MessageType.Info); if (GUILayout.Button(new GUIContent("Recompile All", "Rebuilds the ink library and recompiles all files. Do this if you're getting unusual errors."))) { InkCompiler.RecompileAll(); } EditorGUILayout.PropertyField(serializedObject.FindProperty("templateFile")); if (serializedObject.FindProperty("templateFile").objectReferenceValue == null) { EditorGUILayout.HelpBox("Template not found. New files will be blank.", MessageType.Error); } data.compileAutomatically = EditorGUILayout.Toggle(new GUIContent("Compile Ink Automatically", "When disabled, automatic compilation can be enabled on a per-story basis via the inspector for a master story file."), data.compileAutomatically); data.handleJSONFilesAutomatically = EditorGUILayout.Toggle(new GUIContent("Handle JSON Automatically", "Whether JSON files are moved, renamed and deleted along with their ink files."), data.handleJSONFilesAutomatically); EditorGUILayout.PropertyField(serializedObject.FindProperty("customInklecateName")); EditorGUILayout.PropertyField(serializedObject.FindProperty("runInklecateWithMono")); EditorGUILayout.PropertyField(serializedObject.FindProperty("additionalCompilerOptions")); debugLibrary = EditorGUILayout.Toggle(new GUIContent("Show Library (Debugging)", "Hidden by default, you can view the ink library for debugging purposes. Be wary if editing!"), debugLibrary); if (debugLibrary) { // base.OnInspectorGUI(); EditorGUILayout.PropertyField(serializedObject.FindProperty("inkLibrary"), true); EditorGUILayout.PropertyField(serializedObject.FindProperty("compilationStack"), true); } if (GUI.changed && target != null) { EditorUtility.SetDirty(target); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); if (GUILayout.Button(new GUIContent("Recompile All", "Rebuilds the ink library and recompiles all files. Do this if you're getting unusual errors."))) { InkCompiler.RecompileAll(); } if (serializedObject.FindProperty("templateFile").objectReferenceValue == null) { EditorGUILayout.HelpBox("Template not found. New files will be blank.", MessageType.Info); } EditorGUILayout.PropertyField(serializedObject.FindProperty("templateFile")); data.compileAutomatically = EditorGUILayout.Toggle(new GUIContent("Compile Ink Automatically", "When disabled, automatic compilation can be enabled on a per-story basis via the inspector for a master story file."), data.compileAutomatically); data.handleJSONFilesAutomatically = EditorGUILayout.Toggle(new GUIContent("Handle JSON Automatically", "Whether JSON files are moved, renamed and deleted along with their ink files."), data.handleJSONFilesAutomatically); EditorGUILayout.PropertyField(serializedObject.FindProperty("customInklecateOptions"), new GUIContent("Custom Inklecate (Advanced)", "For games using a custom version of ink"), true); if (GUI.changed && target != null) { EditorUtility.SetDirty(target); } serializedObject.ApplyModifiedProperties(); }
static void PostprocessInklecate(string inklecateFileLocation) { Debug.Log("Inklecate updated. Recompiling all Ink files..."); InkCompiler.RecompileAll(); }