public override void OnInspectorGUI() { DrawDefaultInspector(); EditorHelper.SeparatorUI(); if (script.isActiveAndEnabled) { GUILayout.Label("Internet Status", EditorStyles.boldLabel); GUILayout.BeginHorizontal(); { GUILayout.Label("Available:"); GUI.enabled = false; EditorGUILayout.Toggle(new GUIContent(string.Empty, "Is Internet currently available?"), Tool.InternetCheck.isInternetAvailable); GUI.enabled = true; } GUILayout.EndHorizontal(); if (Util.Helper.isEditorMode) { if (GUILayout.Button(new GUIContent("Refresh", EditorHelper.Icon_Reset, "Restart the Internet availability check."))) { Tool.InternetCheck.Refresh(); } } } else { GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }
protected static void showConfiguration() { GUILayout.Label("General Settings", EditorStyles.boldLabel); Constants.ASSET_PATH = EditorGUILayout.TextField(new GUIContent("Asset Path", "Path to the asset inside the Unity-project (default: " + Constants.DEFAULT_ASSET_PATH + ")."), Constants.ASSET_PATH); Constants.DEBUG = EditorGUILayout.Toggle(new GUIContent("Debug", "Enable or disable debug logs (default: off)."), Constants.DEBUG); Constants.UPDATE_CHECK = EditorGUILayout.BeginToggleGroup(new GUIContent("Update check", "Enable or disable the update-check (default: on)."), Constants.UPDATE_CHECK); EditorGUI.indentLevel++; Constants.UPDATE_OPEN_UAS = EditorGUILayout.Toggle(new GUIContent("Open UAS-site", "Automatically opens the direct link to 'Unity AssetStore' if an update was found (default: off)."), Constants.UPDATE_OPEN_UAS); EditorGUI.indentLevel--; EditorGUILayout.EndToggleGroup(); //Constants.DONT_DESTROY_ON_LOAD = EditorGUILayout.Toggle(new GUIContent("Don't destroy on load", "Don't destroy RTVoice during scene switches (default: on, off is NOT RECOMMENDED!)."), Constants.DONT_DESTROY_ON_LOAD); Constants.PREFAB_AUTOLOAD = EditorGUILayout.Toggle(new GUIContent("Prefab auto-load", "Enable or disable auto-loading of the prefabs to the scene (default: on)."), Constants.PREFAB_AUTOLOAD); Constants.AUDIOFILE_PATH = EditorGUILayout.TextField(new GUIContent("Audio path", "Path to the generated audio files (default: " + Constants.DEFAULT_AUDIOFILE_PATH + ")."), Constants.AUDIOFILE_PATH); Constants.AUDIOFILE_AUTOMATIC_DELETE = EditorGUILayout.Toggle(new GUIContent("Audio auto-delete", "Enable or disable auto-delete of the generated audio files (default: on)."), Constants.AUDIOFILE_AUTOMATIC_DELETE); EditorHelper.SeparatorUI(); GUILayout.Label("Windows Settings", EditorStyles.boldLabel); Constants.ENFORCE_32BIT_WINDOWS = EditorGUILayout.Toggle(new GUIContent("Enforce 32bit voices", "Enforce 32bit versions of voices under Windows (default: off)."), Constants.ENFORCE_32BIT_WINDOWS); //EditorHelper.SeparatorUI(); //GUILayout.Label("macOS Settings", EditorStyles.boldLabel); //Constants.TTS_MACOS = EditorGUILayout.TextField(new GUIContent("TTS-command", "TTS-command under macOS (default: " + Constants.DEFAULT_TTS_MACOS + ")."), Constants.TTS_MACOS); }
public override void OnInspectorGUI() { DrawDefaultInspector(); EditorHelper.SeparatorUI(); if (script.isActiveAndEnabled) { if (Util.Helper.isEditorMode) { GUILayout.Label("HTTP-Proxy:", EditorStyles.boldLabel); if (Tool.Proxy.hasHTTPProxy) { if (GUILayout.Button(new GUIContent("Disable", EditorHelper.Icon_Minus, "Disable HTTP-Proxy."))) { script.DisableHTTPProxy(); } } else { if (GUILayout.Button(new GUIContent("Enable", EditorHelper.Icon_Plus, "Enable HTTP-Proxy."))) { script.EnableHTTPProxy(); } } GUILayout.Space(8); GUILayout.Label("HTTPS-Proxy:", EditorStyles.boldLabel); if (Tool.Proxy.hasHTTPSProxy) { if (GUILayout.Button(new GUIContent("Disable", EditorHelper.Icon_Minus, "Disable HTTPS-Proxy."))) { script.DisableHTTPSProxy(); } } else { if (GUILayout.Button(new GUIContent("Enable", EditorHelper.Icon_Plus, "Enable HTTPS-Proxy."))) { script.EnableHTTPSProxy(); } } } else { GUILayout.Label("Disabled in Play-mode!"); } } else { GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }
public void OnGUI() { tab = GUILayout.Toolbar(tab, new string[] { "Config", "Prefabs", "TD", "Help", "About" }); if (tab != lastTab) { lastTab = tab; GUI.FocusControl(null); } if (tab == 0) { showConfiguration(); EditorHelper.SeparatorUI(); GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent("Save", EditorHelper.Icon_Save, "Saves the configuration settings for this project."))) { save(); } if (GUILayout.Button(new GUIContent("Reset", EditorHelper.Icon_Reset, "Resets the configuration settings for this project."))) { if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Util.Constants.ASSET_NAME + "?", "Yes", "No")) { Util.Constants.Reset(); save(); } } } GUILayout.EndHorizontal(); GUILayout.Space(6); } else if (tab == 1) { showPrefabs(); } else if (tab == 2) { showTestDrive(); } else if (tab == 3) { showHelp(); } else { showAbout(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); EditorHelper.SeparatorUI(); if (script.isActiveAndEnabled) { if (Speaker.isTTSAvailable) { GUILayout.Label("Test-Drive", EditorStyles.boldLabel); if (Util.Helper.isEditorMode) { GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent("Speak", EditorHelper.Icon_Speak, "Speaks the text with the selected voice and settings."))) { script.Speak(); } if (GUILayout.Button(new GUIContent("Silence", EditorHelper.Icon_Silence, "Silence the active speaker."))) { script.Silence(); } } GUILayout.EndHorizontal(); EditorHelper.SeparatorUI(); GUILayout.Label("Editor", EditorStyles.boldLabel); if (GUILayout.Button(new GUIContent("Refresh AssetDatabase", EditorHelper.Icon_Refresh, "Refresh the AssetDatabase from the Editor."))) { refreshAssetDatabase(); } } else { GUILayout.Label("Disabled in Play-mode!"); } } else { EditorHelper.NoVoicesUI(); } } else { GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }
private void showTestDrive() { if (Util.Helper.isEditorMode) { if (Speaker.Voices.Count > 0) { scrollPosTD = EditorGUILayout.BeginScrollView(scrollPosTD, false, false); { GUILayout.Label("Test-Drive", EditorStyles.boldLabel); text = EditorGUILayout.TextField("Text: ", text); voiceIndex = EditorGUILayout.Popup("Voice", voiceIndex, Speaker.Voices.CTToString().ToArray()); rate = EditorGUILayout.Slider("Rate", rate, 0f, 3f); if (Util.Helper.isWindowsPlatform) { volume = EditorGUILayout.Slider("Volume", volume, 0f, 1f); } } EditorGUILayout.EndScrollView(); EditorHelper.SeparatorUI(); GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent("Speak", EditorHelper.Icon_Speak, "Speaks the text with the selected voice and settings."))) { Speaker.SpeakNativeInEditor(text, Speaker.Voices[voiceIndex], rate, volume); silenced = false; } if (GUILayout.Button(new GUIContent("Silence", EditorHelper.Icon_Silence, "Silence all active speakers."))) { silence(); } } GUILayout.EndHorizontal(); GUILayout.Space(6); } else { EditorHelper.NoVoicesUI(); } } else { GUILayout.Label("Disabled in Play-mode!"); } }
private void showTestDrive() { if (Helper.isEditorMode) { voices.Clear(); for (int voiceNumber = 0; voiceNumber < Speaker.Voices.Count; voiceNumber++) { voices.Add(voiceNumber + ": " + Speaker.Voices[voiceNumber].Name); } if (voices.Count > 0) { GUILayout.Label("Setup", EditorStyles.boldLabel); text = EditorGUILayout.TextField("Text: ", text); voiceIndex = EditorGUILayout.Popup("Voice", voiceIndex, voices.ToArray()); rate = EditorGUILayout.Slider("Rate", rate, 0f, 3f); if (Helper.isWindowsPlatform) { volume = EditorGUILayout.Slider("Volume", volume, 0f, 1f); } EditorHelper.SeparatorUI(); if (GUILayout.Button(new GUIContent("Speak", "Speaks the text with the selected voice and settings."))) { Speaker.SpeakNativeInEditor(text, Speaker.Voices[voiceIndex], rate, volume); silenced = false; } if (GUILayout.Button(new GUIContent("Silence", "Silence all active speakers."))) { silence(); } } else { EditorHelper.NoVoicesUI(); } } else { GUILayout.Label("Disabled in Play-mode!"); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); if (script.isActiveAndEnabled) { if (!Speaker.isTTSAvailable) { EditorHelper.SeparatorUI(); EditorHelper.NoVoicesUI(); } } else { EditorHelper.SeparatorUI(); GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }
private static void PreferencesGUI() { tab = GUILayout.Toolbar(tab, new string[] { "Configuration", "Help", "About" }); if (tab != lastTab) { lastTab = tab; GUI.FocusControl(null); } if (tab == 0) { showConfiguration(); EditorHelper.SeparatorUI(); if (GUILayout.Button(new GUIContent("Reset", EditorHelper.Icon_Reset, "Resets the configuration settings for this project."))) { if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Util.Constants.ASSET_NAME + "?", "Yes", "No")) { Util.Constants.Reset(); save(); } } GUILayout.Space(6); } else if (tab == 1) { showHelp(); } else { showAbout(); } if (GUI.changed) { save(); } }
public void OnGUI() { tab = GUILayout.Toolbar(tab, new string[] { "Configuration", "Test-Drive", "About" }); if (tab != lastTab) { lastTab = tab; GUI.FocusControl(null); } if (tab == 0) { showConfiguration(); EditorHelper.SeparatorUI(); if (GUILayout.Button(new GUIContent("Save configuration", "Saves the configuration settings for this project."))) { save(); } GUILayout.Space(12); if (GUILayout.Button(new GUIContent("Reset configuration", "Resets the configuration settings for this project."))) { if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Constants.ASSET_NAME + "?", "Yes", "No")) { Constants.Reset(); save(); } } } else if (tab == 1) { showTestDrive(); } else { showAbout(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); EditorHelper.SeparatorUI(); if (script.isActiveAndEnabled) { if (Speaker.isTTSAvailable) { GUILayout.Label("Test-Drive", EditorStyles.boldLabel); if (Helper.isEditorMode) { if (GUILayout.Button(new GUIContent("Speak", "Speaks a random text file with the selected voice and settings."))) { script.Speak(); } if (GUILayout.Button(new GUIContent("Silence", "Silence the active speaker."))) { script.Silence(); } } else { GUILayout.Label("Disabled in Play-mode!"); } } else { EditorHelper.NoVoicesUI(); } } else { GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }
protected static void showHelp() { scrollPosHelp = EditorGUILayout.BeginScrollView(scrollPosHelp, false, false); { GUILayout.Label("Resources", EditorStyles.boldLabel); //GUILayout.Space(8); GUILayout.BeginHorizontal(); { GUILayout.BeginVertical(); { if (GUILayout.Button(new GUIContent("Manual", EditorHelper.Icon_Manual, "Show the manual."))) { Application.OpenURL(Util.Constants.ASSET_MANUAL_URL); } GUILayout.Space(6); if (GUILayout.Button(new GUIContent("Forum", EditorHelper.Icon_Forum, "Visit the forum page."))) { Application.OpenURL(Util.Constants.ASSET_FORUM_URL); } } GUILayout.EndVertical(); GUILayout.BeginVertical(); { if (GUILayout.Button(new GUIContent("API", EditorHelper.Icon_API, "Show the API."))) { Application.OpenURL(Util.Constants.ASSET_API_URL); } GUILayout.Space(6); if (GUILayout.Button(new GUIContent("Product", EditorHelper.Icon_Product, "Visit the product page."))) { Application.OpenURL(Util.Constants.ASSET_WEB_URL); } } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); EditorHelper.SeparatorUI(); GUILayout.Label("3rd Party Assets", EditorStyles.boldLabel); // GUILayout.BeginHorizontal (); // { GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_PlayMaker, "More information about 'PlayMaker'."))) { Application.OpenURL(Util.Constants.ASSET_3P_PLAYMAKER); //Application.OpenURL(Util.Constants.ASSET_3RD_PARTY_URL); } if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_AdventureCreator, "More information about 'Adventure Creator'."))) { Application.OpenURL(Util.Constants.ASSET_3P_ADVENTURE_CREATOR); } if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_CinemaDirector, "More information about 'Cinema Director'."))) { Application.OpenURL(Util.Constants.ASSET_3P_CINEMA_DIRECTOR); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_DialogueSystem, "More information about 'Dialogue System'."))) { Application.OpenURL(Util.Constants.ASSET_3P_DIALOG_SYSTEM); } if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_LDC, "More information about 'Localized Dialogs'."))) { Application.OpenURL(Util.Constants.ASSET_3P_LOCALIZED_DIALOGS); } //GUILayout.Space (6); if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_LipSync, "More information about 'LipSync'."))) { Application.OpenURL(Util.Constants.ASSET_3P_LIPSYNC); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_NPC_Chat, "More information about 'NPC Chat'."))) { Application.OpenURL(Util.Constants.ASSET_3P_NPC_CHAT); } //GUILayout.Space (6); if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_QuestSystem, "More information about 'Quest System'."))) { Application.OpenURL(Util.Constants.ASSET_3P_QUEST_SYSTEM); } if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_SALSA, "More information about 'SALSA'."))) { Application.OpenURL(Util.Constants.ASSET_3P_SALSA); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); { //GUILayout.Space (6); if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_SLATE, "More information about 'SLATE'."))) { Application.OpenURL(Util.Constants.ASSET_3P_SLATE); } if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_THE_Dialogue_Engine, "More information about 'THE Dialogue Engine'."))) { Application.OpenURL(Util.Constants.ASSET_3P_DIALOGUE_ENGINE); } //GUILayout.Space (6); if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Store_uSequencer, "More information about 'uSequencer'."))) { Application.OpenURL(Util.Constants.ASSET_3P_USEQUENCER); } } GUILayout.EndHorizontal(); // } // GUILayout.EndHorizontal (); GUILayout.Space(6); if (GUILayout.Button(new GUIContent("All Supported Assets", EditorHelper.Icon_3p_Assets, "More information about the all supported assets."))) { Application.OpenURL(Util.Constants.ASSET_3P_URL); //Application.OpenURL(Util.Constants.ASSET_3RD_PARTY_URL); } } EditorGUILayout.EndScrollView(); GUILayout.Space(6); }
protected static void showAbout() { scrollPosAbout = EditorGUILayout.BeginScrollView(scrollPosAbout, false, false); { GUILayout.Label(Util.Constants.ASSET_NAME, EditorStyles.boldLabel); GUILayout.BeginHorizontal(); { GUILayout.BeginVertical(GUILayout.Width(60)); { GUILayout.Label("Version:"); GUILayout.Space(12); GUILayout.Label("Web:"); GUILayout.Space(2); GUILayout.Label("Email:"); } GUILayout.EndVertical(); GUILayout.BeginVertical(GUILayout.Width(170)); { GUILayout.Space(0); GUILayout.Label(Util.Constants.ASSET_VERSION); GUILayout.Space(12); EditorGUILayout.SelectableLabel(Util.Constants.ASSET_AUTHOR_URL, GUILayout.Height(16), GUILayout.ExpandHeight(false)); GUILayout.Space(2); EditorGUILayout.SelectableLabel(Util.Constants.ASSET_CONTACT, GUILayout.Height(16), GUILayout.ExpandHeight(false)); } GUILayout.EndVertical(); GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); { //GUILayout.Space(0); } GUILayout.EndVertical(); GUILayout.BeginVertical(GUILayout.Width(64)); { //GUILayout.Label(logo_asset, GUILayout.Height(80)); if (GUILayout.Button(new GUIContent(string.Empty, EditorHelper.Logo_Asset, "Visit asset website"))) { Application.OpenURL(Util.Constants.ASSET_URL); } if (!Util.Constants.isPro) { if (GUILayout.Button(new GUIContent("Upgrade", "Upgrade " + Util.Constants.ASSET_NAME + " to the PRO-version"))) { Application.OpenURL(Util.Constants.ASSET_PRO_URL); } } } GUILayout.EndVertical(); } GUILayout.EndHorizontal(); GUILayout.Label("© 2015-2017 by " + Util.Constants.ASSET_AUTHOR); EditorHelper.SeparatorUI(); if (UpdateCheck.Status == UpdateStatus.NOT_CHECKED || UpdateCheck.Status == UpdateStatus.NO_UPDATE) { if (worker == null || (worker != null && !worker.IsAlive)) { if (!Tool.InternetCheck.isInternetAvailable) { GUI.enabled = false; } if (GUILayout.Button(new GUIContent("Check For Update", EditorHelper.Icon_Check, "Checks for available updates of " + Util.Constants.ASSET_NAME))) { worker = new System.Threading.Thread(() => UpdateCheck.UpdateCheckForEditor(out updateText)); worker.Start(); } GUI.enabled = true; } else { GUILayout.Label("Checking... Please wait.", EditorStyles.boldLabel); } } Color fgColor = GUI.color; GUI.color = Color.yellow; if (UpdateCheck.Status == UpdateStatus.NO_UPDATE) { GUI.color = Color.green; GUILayout.Label(updateText); } else if (UpdateCheck.Status == UpdateStatus.UPDATE) { GUILayout.Label(updateText); if (GUILayout.Button(new GUIContent("Download", "Visit the 'Unity AssetStore' to download the latest version."))) { Application.OpenURL(Util.Constants.ASSET_URL); } } else if (UpdateCheck.Status == UpdateStatus.UPDATE_PRO) { GUILayout.Label(updateText); if (GUILayout.Button(new GUIContent("Upgrade", "Upgrade to the PRO-version in the 'Unity AssetStore'."))) { Application.OpenURL(Util.Constants.ASSET_PRO_URL); } } else if (UpdateCheck.Status == UpdateStatus.UPDATE_VERSION) { GUILayout.Label(updateText); if (GUILayout.Button(new GUIContent("Upgrade", "Upgrade to the newer version in the 'Unity AssetStore'"))) { Application.OpenURL(Util.Constants.ASSET_CT_URL); } } else if (UpdateCheck.Status == UpdateStatus.DEPRECATED) { GUILayout.Label(updateText); if (GUILayout.Button(new GUIContent("More Information", "Visit the 'crosstales'-site for more information."))) { Application.OpenURL(Util.Constants.ASSET_AUTHOR_URL); } } else { GUI.color = Color.cyan; GUILayout.Label(updateText); } GUI.color = fgColor; } EditorGUILayout.EndScrollView(); EditorHelper.SeparatorUI(); GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent("AssetStore", EditorHelper.Logo_Unity, "Visit the 'Unity AssetStore' website."))) { Application.OpenURL(Util.Constants.ASSET_CT_URL); } if (GUILayout.Button(new GUIContent(Util.Constants.ASSET_AUTHOR, EditorHelper.Logo_CT, "Visit the '" + Util.Constants.ASSET_AUTHOR + "' website."))) { Application.OpenURL(Util.Constants.ASSET_AUTHOR_URL); } } GUILayout.EndHorizontal(); GUILayout.Space(6); }
protected static void showAbout() { GUILayout.Label(Constants.ASSET_NAME, EditorStyles.boldLabel); GUILayout.Label("Version:\t" + Constants.ASSET_VERSION); GUILayout.Space(6); GUILayout.Label("Web:\t" + Constants.ASSET_AUTHOR_URL); GUILayout.Label("Email:\t" + Constants.ASSET_CONTACT); GUILayout.Space(12); GUILayout.Label("© 2015-2016 by " + Constants.ASSET_AUTHOR); EditorHelper.SeparatorUI(); if (worker == null || (worker != null && !worker.IsAlive)) { if (GUILayout.Button(new GUIContent("Check for update", "Checks for available updates of " + Constants.ASSET_NAME))) { worker = new Thread(() => UpdateCheck.UpdateCheckForEditor(out updateText)); worker.Start(); } } else { GUILayout.Label("Checking... Please wait.", EditorStyles.boldLabel); } Color fgColor = GUI.color; if (updateText.Equals(UpdateCheck.TEXT_NOT_CHECKED)) { GUI.color = Color.cyan; GUILayout.Label(updateText); } else if (updateText.Equals(UpdateCheck.TEXT_NO_UPDATE)) { GUI.color = Color.green; GUILayout.Label(updateText); } else { GUI.color = Color.yellow; GUILayout.Label(updateText); if (GUILayout.Button(new GUIContent("Download", "Opens the 'Unity AssetStore' for downloading the latest version."))) { Application.OpenURL(Constants.ASSET_URL); } } GUI.color = fgColor; EditorHelper.SeparatorUI(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Manual", "Opens the manual."))) { Application.OpenURL(Constants.ASSET_MANUAL_URL); } if (GUILayout.Button(new GUIContent("API", "Opens the API."))) { Application.OpenURL(Constants.ASSET_API_URL); } if (GUILayout.Button(new GUIContent("Forum", "Opens the forum page."))) { Application.OpenURL(Constants.ASSET_FORUM_URL); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Unity AssetStore", "Opens the 'Unity AssetStore' page."))) { Application.OpenURL(Constants.ASSET_URL); } if (GUILayout.Button(new GUIContent("Product", "Opens the product page."))) { Application.OpenURL(Constants.ASSET_CT_URL); } if (GUILayout.Button(new GUIContent(Constants.ASSET_AUTHOR, "Opens the 'crosstales' page."))) { Application.OpenURL(Constants.ASSET_AUTHOR_URL); } EditorGUILayout.EndHorizontal(); }
private static void showPrefabs() { scrollPosPrefabs = EditorGUILayout.BeginScrollView(scrollPosPrefabs, false, false); { //GUILayout.Space(8); GUILayout.Label("Available Prefabs", EditorStyles.boldLabel); GUILayout.Space(6); //EditorHelper.SeparatorUI (6); if (!EditorHelper.isRTVoiceInScene) { GUILayout.Label("RTVoice"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'RTVoice'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("RTVoice"); } EditorHelper.SeparatorUI(); } GUILayout.Label("SpeechText"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'SpeechText'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("SpeechText"); } GUILayout.Space(6); GUILayout.Label("Sequencer"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'Sequencer'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("Sequencer"); } GUILayout.Space(6); GUILayout.Label("TextFileSpeaker"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'TextFileSpeaker'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("TextFileSpeaker"); } EditorHelper.SeparatorUI(); GUILayout.Label("Loudspeaker"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'Loudspeaker'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("Loudspeaker"); } if (!EditorHelper.isProxyInScene) { EditorHelper.SeparatorUI(); GUILayout.Label("Proxy"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'Proxy'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("Proxy"); } } GUILayout.Space(6); } EditorGUILayout.EndScrollView(); }
private static void showPrefabs() { scrollPosPrefabs = EditorGUILayout.BeginScrollView(scrollPosPrefabs, false, false); { //GUILayout.Space(8); GUILayout.Label("Available Prefabs", EditorStyles.boldLabel); GUILayout.Space(6); //EditorHelper.SeparatorUI (6); if (!EditorHelper.isRTVoiceInScene) { GUILayout.Label(Util.Constants.RTVOICE_SCENE_OBJECT_NAME); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a '" + Util.Constants.RTVOICE_SCENE_OBJECT_NAME + "'-prefab to the scene."))) { EditorHelper.InstantiatePrefab(Util.Constants.RTVOICE_SCENE_OBJECT_NAME); } EditorHelper.SeparatorUI(); } GUILayout.Label("SpeechText"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'SpeechText'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("SpeechText"); } GUILayout.Space(6); GUILayout.Label("Sequencer"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'Sequencer'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("Sequencer"); } GUILayout.Space(6); GUILayout.Label("TextFileSpeaker"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'TextFileSpeaker'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("TextFileSpeaker"); } EditorHelper.SeparatorUI(); GUILayout.Label("Loudspeaker"); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a 'Loudspeaker'-prefab to the scene."))) { EditorHelper.InstantiatePrefab("Loudspeaker"); } if (!EditorHelper.isInternetCheckInScene) { EditorHelper.SeparatorUI(); GUILayout.Label(Util.Constants.INTERNETCHECK_SCENE_OBJECT_NAME); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a '" + Util.Constants.INTERNETCHECK_SCENE_OBJECT_NAME + "'-prefab to the scene."))) { EditorHelper.InstantiatePrefab(Util.Constants.INTERNETCHECK_SCENE_OBJECT_NAME); } } if (!EditorHelper.isProxyInScene) { EditorHelper.SeparatorUI(); GUILayout.Label(Util.Constants.PROXY_SCENE_OBJECT_NAME); if (GUILayout.Button(new GUIContent("Add", EditorHelper.Icon_Plus, "Adds a '" + Util.Constants.PROXY_SCENE_OBJECT_NAME + "'-prefab to the scene."))) { EditorHelper.InstantiatePrefab(Util.Constants.PROXY_SCENE_OBJECT_NAME); } } GUILayout.Space(6); } EditorGUILayout.EndScrollView(); }
// public override bool RequiresConstantRepaint() // { // return true; // } public override void OnInspectorGUI() { DrawDefaultInspector(); // GUILayout.Space(8); // // script.MaryTTSMode = EditorGUILayout.BeginToggleGroup(new GUIContent("MaryTTS", "Enable or disable the MaryTTS-mode (default: off)."), script.MaryTTSMode); // EditorGUI.indentLevel++; // script.MaryTTSURL = EditorGUILayout.TextField(new GUIContent("URL", "Server URL for MaryTTS."), script.MaryTTSURL); // script.MaryTTSPort = EditorGUILayout.IntSlider(new GUIContent("Port", "Server port for MaryTTS."), script.MaryTTSPort, 0, 65535); // EditorGUI.indentLevel--; // EditorGUILayout.EndToggleGroup(); EditorHelper.SeparatorUI(); if (script.isActiveAndEnabled) { GUILayout.Label("Data", EditorStyles.boldLabel); showVoices = EditorGUILayout.Foldout(showVoices, "Voices (" + Speaker.Voices.Count + ")"); if (showVoices) { EditorGUI.indentLevel++; foreach (string voice in Speaker.Voices.CTToString()) { EditorGUILayout.SelectableLabel(voice, GUILayout.Height(16), GUILayout.ExpandHeight(false)); } EditorGUI.indentLevel--; } EditorHelper.SeparatorUI(); if (Speaker.Voices.Count > 0) { GUILayout.Label("Test-Drive", EditorStyles.boldLabel); if (Util.Helper.isEditorMode) { voiceIndex = EditorGUILayout.Popup("Voice", voiceIndex, Speaker.Voices.CTToString().ToArray()); rate = EditorGUILayout.Slider("Rate", rate, 0f, 3f); if (Util.Helper.isWindowsPlatform) { volume = EditorGUILayout.Slider("Volume", volume, 0f, 1f); } GUILayout.Space(8); GUILayout.BeginHorizontal(); { if (GUILayout.Button(new GUIContent("Preview Voice", EditorHelper.Icon_Speak, "Preview the selected voice."))) { Speaker.SpeakNativeInEditor("You have selected " + Speaker.Voices[voiceIndex].Name, Speaker.Voices[voiceIndex], rate, volume); } if (GUILayout.Button(new GUIContent("Silence", EditorHelper.Icon_Silence, "Silence all active previews."))) { Speaker.Silence(); } } GUILayout.EndHorizontal(); } else { GUILayout.Label("Disabled in Play-mode!"); } } } else { GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); EditorHelper.SeparatorUI(); if (script.isActiveAndEnabled) { GUILayout.Label("Data", EditorStyles.boldLabel); showVoices = EditorGUILayout.Foldout(showVoices, "Voices (" + Speaker.Voices.Count + ")"); if (showVoices) { EditorGUI.indentLevel++; foreach (Voice voice in Speaker.Voices) { EditorGUILayout.SelectableLabel(voice.ToShortString()); } EditorGUI.indentLevel--; } EditorHelper.SeparatorUI(); if (voices.Count > 0) { GUILayout.Label("Test-Drive", EditorStyles.boldLabel); if (Helper.isEditorMode) { voiceIndex = EditorGUILayout.Popup("Voice", voiceIndex, voices.ToArray()); rate = EditorGUILayout.Slider("Rate", rate, 0f, 3f); if (Helper.isWindowsPlatform) { volume = EditorGUILayout.Slider("Volume", volume, 0f, 1f); } GUILayout.Space(8); if (GUILayout.Button(new GUIContent("Preview Voice", "Preview the selected voice."))) { Speaker.SpeakNativeInEditor("You have selected " + Speaker.Voices[voiceIndex].Name, Speaker.Voices[voiceIndex], rate, volume); } if (GUILayout.Button(new GUIContent("Silence", "Silence all active previews."))) { Speaker.Silence(); } } else { GUILayout.Label("Disabled in Play-mode!"); } } else { loadVoices(); } } else { GUILayout.Label("Script is disabled!", EditorStyles.boldLabel); } }