static void Init() { ConversationEditorWindow window = (ConversationEditorWindow)EditorWindow.GetWindow(typeof(ConversationEditorWindow)); window.Repaint(); UnityVersionHandler.SetWindowTitle(window, "Conversation Editor"); }
static void Init() { ConversationEditorWindow window = (ConversationEditorWindow)EditorWindow.GetWindow(typeof(ConversationEditorWindow)); window.Repaint(); window.titleContent.text = "Conversation Editor"; }
static void Init() { ConversationEditorWindow window = (ConversationEditorWindow)EditorWindow.GetWindow(typeof(ConversationEditorWindow)); window.Repaint(); AdvGame.SetWindowTitle(window, "Conversation Editor"); }
public override void OnInspectorGUI() { if (_target) { _target.Upgrade(); } else { return; } EditorGUILayout.BeginVertical("Button"); EditorGUILayout.LabelField("Conversation settings", EditorStyles.boldLabel); _target.interactionSource = (AC.InteractionSource)EditorGUILayout.EnumPopup("Interaction source:", _target.interactionSource); _target.autoPlay = EditorGUILayout.Toggle("Auto-play lone option?", _target.autoPlay); _target.isTimed = EditorGUILayout.Toggle("Is timed?", _target.isTimed); if (_target.isTimed) { _target.timer = EditorGUILayout.FloatField("Timer length (s):", _target.timer); if (_target.options != null && _target.options.Count > 0) { bool noDefault = (_target.defaultOption < 0); noDefault = EditorGUILayout.Toggle("End if timer runs out?", noDefault); if (noDefault) { _target.defaultOption = -1; } else if (_target.defaultOption < 0) { _target.defaultOption = 0; } } else { _target.defaultOption = -1; } } if (GUILayout.Button("Conversation Editor")) { ConversationEditorWindow window = (ConversationEditorWindow)EditorWindow.GetWindow(typeof(ConversationEditorWindow)); window.Repaint(); } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); CreateOptionsGUI(); EditorGUILayout.Space(); if (_target.selectedOption != null && _target.options.Contains(_target.selectedOption)) { EditorGUILayout.LabelField("Dialogue option '" + _target.selectedOption.label + "' properties", EditorStyles.boldLabel); EditOptionGUI(_target.selectedOption, _target.interactionSource); } UnityVersionHandler.CustomSetDirty(_target); }
public override void OnInspectorGUI() { if (_target) { _target.Upgrade(); } else { return; } EditorGUILayout.BeginVertical("Button"); EditorGUILayout.LabelField("Conversation settings", EditorStyles.boldLabel); _target.interactionSource = (AC.InteractionSource)CustomGUILayout.EnumPopup("Interaction source:", _target.interactionSource, "", "The source of the commands that are run when an option is chosen"); _target.autoPlay = CustomGUILayout.Toggle("Auto-play lone option?", _target.autoPlay, "", "If True, and only one option is available, then the option will be chosen automatically"); _target.isTimed = CustomGUILayout.Toggle("Is timed?", _target.isTimed, "", "If True, then the Conversation is timed, and the options will only be shown for a fixed period"); if (_target.isTimed) { _target.timer = CustomGUILayout.FloatField("Timer length (s):", _target.timer, "", "The duration, in seconds, that the Conversation is active"); if (_target.options != null && _target.options.Count > 0) { bool noDefault = (_target.defaultOption < 0); noDefault = CustomGUILayout.Toggle("End if timer runs out?", noDefault, "", "If True, the Conversation will end when the timer runs out - and no option will be chosen"); if (noDefault) { _target.defaultOption = -1; } else if (_target.defaultOption < 0) { _target.defaultOption = 0; } } else { _target.defaultOption = -1; } } if (GUILayout.Button("Conversation Editor")) { ConversationEditorWindow window = (ConversationEditorWindow)EditorWindow.GetWindow(typeof(ConversationEditorWindow)); window.Repaint(); } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); CreateOptionsGUI(); EditorGUILayout.Space(); if (_target.selectedOption != null && _target.options.Contains(_target.selectedOption)) { EditorGUILayout.LabelField("Dialogue option '" + _target.selectedOption.label + "' properties", EditorStyles.boldLabel); EditOptionGUI(_target.selectedOption, _target.interactionSource); } UnityVersionHandler.CustomSetDirty(_target); }
public override void OnInspectorGUI() { if (!sideIcon) { sideIcon = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/AdventureCreator/Graphics/Textures/inspector-use.png", typeof(Texture2D)); } if (_target) { _target.Upgrade(); } else { return; } EditorGUILayout.BeginVertical("Button"); EditorGUILayout.LabelField("Conversation settings", EditorStyles.boldLabel); _target.interactionSource = (InteractionSource)EditorGUILayout.EnumPopup("Interaction source:", _target.interactionSource); _target.autoPlay = EditorGUILayout.Toggle("Auto-play lone option?", _target.autoPlay); _target.isTimed = EditorGUILayout.Toggle("Is timed?", _target.isTimed); if (_target.isTimed) { _target.timer = EditorGUILayout.FloatField("Timer length (s):", _target.timer); } if (GUILayout.Button("Conversation Editor")) { ConversationEditorWindow window = (ConversationEditorWindow)EditorWindow.GetWindow(typeof(ConversationEditorWindow)); window.Repaint(); } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); CreateOptionsGUI(); EditorGUILayout.Space(); if (_target.selectedOption != null && _target.options.Contains(_target.selectedOption)) { EditorGUILayout.LabelField("Dialogue option '" + _target.selectedOption.label + "' properties", EditorStyles.boldLabel); EditOptionGUI(_target.selectedOption, _target.interactionSource); } if (GUI.changed) { EditorUtility.SetDirty(_target); } }