Exemple #1
0
        public override void EditOption(Option option)
        {
            if (Application.isPlaying)
            {
                if (option.EditGUI())
                {
                    option.ApplyFromRoot();
                }
                return;
            }

            Option editModeOption = null;

            if (editModeProfile != null)
            {
                editModeOption = editModeProfile.GetOption(option.Path);
            }

            if (editModeOption != null)
            {
                if (editModeOption.EditGUI())
                {
                    Option.changed = true;
                    editModeOption.ApplyFromRoot();
                }
            }
            else
            {
                if (option.EditGUI())
                {
                    Option.changed = true;
                }
            }
        }
Exemple #2
0
        public override void EditOption(Option option)
        {
            try {
                if (Application.isPlaying)
                {
                    if (option.EditGUI())
                    {
                        option.ApplyFromRoot();
                    }
                    return;
                }

                Option editModeOption = null;
                if (editModeProfile != null)
                {
                    editModeOption = editModeProfile.GetOption(option.Path);
                }

                if (editModeOption != null)
                {
                    if (editModeOption.EditGUI())
                    {
                        Option.changed = true;
                        editModeOption.ApplyFromRoot();
                    }
                }
                else
                {
                    if (option.EditGUI())
                    {
                        Option.changed = true;
                    }
                }
            } catch (Exception e) {
                EditorGUILayout.HelpBox($"Error showing the Option GUI:\n{e.Message}", MessageType.Error);
            }
        }