public override void OnInspectorGUI()
        {
            var comm = (DissonanceComms)target;

            using (var changed = new EditorGUI.ChangeCheckScope())
            {
                GUILayout.Label(_logo);

                CommsNetworkGui();
                DissonanceCommsGui();

                PlaybackPrefabGui(comm);

                comm.ChangeWithUndo(
                    "Changed Dissonance Mute",
                    EditorGUILayout.Toggle("Mute", comm.IsMuted),
                    comm.IsMuted,
                    a => comm.IsMuted = a
                    );

                comm.ChangeWithUndo(
                    "Changed Dissonance Deafen",
                    EditorGUILayout.Toggle("Deafen", comm.IsDeafened),
                    comm.IsDeafened,
                    a => comm.IsDeafened = a
                    );

                if (Application.isPlaying)
                {
                    EditorGUILayout.Space();
                    StatusGui(comm);
                }

                _tokenEditor.DrawInspectorGui(comm, comm);

                if (GUILayout.Button("Voice Settings"))
                {
                    VoiceSettingsEditor.GoToSettings();
                }

                if (GUILayout.Button("Configure Rooms"))
                {
                    ChatRoomSettingsEditor.GoToSettings();
                }

                if (GUILayout.Button("Diagnostic Settings"))
                {
                    DebugSettingsEditor.GoToSettings();
                }

                Undo.FlushUndoRecordObjects();

                if (changed.changed)
                {
                    EditorUtility.SetDirty(comm);
                }
                serializedObject.ApplyModifiedPropertiesWithoutUndo();
            }
        }
示例#2
0
        public override void OnInspectorGUI()
        {
            CreateSkin();

            var comm = (DissonanceComms)target;

            GUILayout.Label(_logo);

            CommsNetworkGui();
            DissonanceCommsGui();

            PlaybackPrefabGui(comm);

            comm.ChangeWithUndo(
                "Changed Dissonance Mute",
                EditorGUILayout.Toggle("Mute", comm.IsMuted),
                comm.IsMuted,
                a => comm.IsMuted = a
                );

            comm.ChangeWithUndo(
                "Changed Dissonance Deafen",
                EditorGUILayout.Toggle("Deafen", comm.IsDeafened),
                comm.IsDeafened,
                a => comm.IsDeafened = a
                );

            EditorGUILayout.Space();

            if (Application.isPlaying)
            {
                StatusGui(comm);

                EditorGUILayout.Space();
            }

            _tokenEditor.DrawInspectorGui(comm, comm);

            if (GUILayout.Button("Voice Settings"))
            {
                VoiceSettingsEditor.GoToSettings();
            }

            if (GUILayout.Button("Configure Rooms"))
            {
                ChatRoomSettingsEditor.GoToSettings();
            }

            if (GUILayout.Button("Diagnostic Settings"))
            {
                DebugSettingsEditor.GoToSettings();
            }

            Undo.FlushUndoRecordObjects();
            EditorUtility.SetDirty(comm);
        }