Exemplo n.º 1
0
        static void DrawSettings(SerializedObject settings)
        {
            var cachedLabelWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 260;
            EditorGUI.BeginChangeCheck();

            EditorGUILayout.HelpBox(versionLabel, MessageType.Info);

            if (settings.FindProperty("templateFile").objectReferenceValue == null)
            {
                EditorGUILayout.HelpBox("Template not found. Ink files created via Assets > Create > Ink will be blank.", MessageType.Info);
            }
            EditorGUILayout.PropertyField(settings.FindProperty("templateFile"), new GUIContent("Ink Template", "Optional. The default content of files created via Assets > Create > Ink."));
            EditorGUILayout.PropertyField(settings.FindProperty("defaultJsonAssetPath"), new GUIContent("New JSON Path", "By default, story JSON files are placed next to the ink. Drag a folder here to place new JSON files there instead."));
            EditorGUILayout.PropertyField(settings.FindProperty("compileAutomatically"), new GUIContent("Compile All Ink Automatically", "When disabled, automatic compilation can be enabled on a per-story basis via the inspector for a master story file. This can be helpful when you have several stories in a single project."));
            EditorGUILayout.PropertyField(settings.FindProperty("delayInPlayMode"), new GUIContent("Delay compilation if in Play Mode", "When enabled, ink compilation is delayed if in play mode. Files will be compiled on re-entering edit mode."));
            EditorGUILayout.PropertyField(settings.FindProperty("printInkLogsInConsoleOnCompile"), new GUIContent("Print ink TODOs in console on compile", "When enabled, ink lines starting with TODO are printed in the console."));
            EditorGUILayout.PropertyField(settings.FindProperty("handleJSONFilesAutomatically"), new GUIContent("Handle JSON Automatically", "Whether JSON files are moved, renamed and deleted along with their ink files."));
            EditorGUILayout.PropertyField(settings.FindProperty("compileTimeout"), new GUIContent("Compile Timeout", "The max time the compiler will attempt to compile for in case of unhanded errors. You may need to increase this for very large ink projects."));

            if (EditorGUI.EndChangeCheck())
            {
                settings.ApplyModifiedProperties();
            }
            EditorGUIUtility.labelWidth = cachedLabelWidth;

            EditorGUILayout.Separator();
            if (GUILayout.Button("Show changelog"))
            {
                InkUnityIntegrationStartupWindow.ShowWindow();
            }
        }
        public static void ShowWindow()
        {
            InkUnityIntegrationStartupWindow window = EditorWindow.GetWindow(typeof(InkUnityIntegrationStartupWindow), true, "Ink Update " + InkLibrary.unityIntegrationVersionCurrent.ToString(), true) as InkUnityIntegrationStartupWindow;

            window.minSize = new Vector2(200, 200);
            var size = new Vector2(520, 320);

            window.position = new Rect((Screen.currentResolution.width - size.x) * 0.5f, (Screen.currentResolution.height - size.y) * 0.5f, size.x, size.y);
            EditorPrefs.SetInt(editorPrefsKeyForVersionSeen, announcementVersion);
        }
 static void DrawVersions()
 {
     EditorGUILayout.LabelField(new GUIContent("Version Info"), EditorStyles.boldLabel);
     EditorGUI.BeginDisabledGroup(true);
     EditorGUILayout.TextField(new GUIContent("Plugin version", "The version of the Ink Unity Integration package."), InkLibrary.unityIntegrationVersionCurrent.ToString());
     EditorGUILayout.TextField(new GUIContent("Ink version", "The version of ink that is included by the Unity package, used to compile and play ink files."), InkLibrary.inkVersionCurrent.ToString());
     EditorGUILayout.TextField(new GUIContent("Ink story format version", "Significant changes to the Ink runtime are recorded by the story format version.\nCompatibility between different versions is limited; see comments at Ink.Runtime.Story.inkVersionCurrent for more details."), Ink.Runtime.Story.inkVersionCurrent.ToString());
     EditorGUILayout.TextField(new GUIContent("Ink save format version", "Version of the ink save/load system.\nCompatibility between different versions is limited; see comments at Ink.Runtime.StoryState.kInkSaveStateVersion for more details."), Ink.Runtime.StoryState.kInkSaveStateVersion.ToString());
     EditorGUI.EndDisabledGroup();
     if (GUILayout.Button("Show changelog"))
     {
         InkUnityIntegrationStartupWindow.ShowWindow();
     }
 }