override public void OnInspectorGUI()
        {
            Undo.RecordObject(_src, "DeAudioCollection");
            DeGUI.BeginGUI();

            GUILayout.Space(4);

            serializedObject.Update();
            _dataList.DoLayoutList();
            serializedObject.ApplyModifiedProperties();
        }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            Undo.RecordObject(_src, "DeAudioManager");
            DeGUI.BeginGUI();

            GUILayout.Label("v" + DeAudioManager.Version, EditorStyles.miniLabel.MarginBottom(0));
            if (Application.isPlaying)
            {
                DrawRuntime();
            }
            else
            {
                DrawDefault();
            }
        }
        public override void OnInspectorGUI()
        {
            Undo.RecordObject(src, "ContinueScreen");
            DeGUI.BeginGUI();

            GUILayout.Label("Settings", DeGUI.styles.label.bold);
            DeGUILayout.Toolbar("Center Position", new DeSkinColor(0.5f, 0.1f));
            using (new DeGUILayout.ToolbarScope(new DeSkinColor(0.5f, 0.1f), DeGUI.styles.toolbar.def)) {
                if (GUILayout.Button("Save", DeGUI.styles.button.tool))
                {
                    src.CenterSnapshot = GetSnapshot();
                    EditorUtility.SetDirty(src);
                }
                if (GUILayout.Button("Apply", DeGUI.styles.button.tool))
                {
                    SetSnapshot(src.CenterSnapshot);
                }
            }
            GUILayout.Space(4);
            DeGUILayout.Toolbar("Side Position", new DeSkinColor(0.5f, 0.1f));
            using (new DeGUILayout.ToolbarScope(new DeSkinColor(0.5f, 0.1f), DeGUI.styles.toolbar.def)) {
                if (GUILayout.Button("Save", DeGUI.styles.button.tool))
                {
                    src.SideSnapshot = GetSnapshot();
                    EditorUtility.SetDirty(src);
                }
                if (GUILayout.Button("Apply", DeGUI.styles.button.tool))
                {
                    SetSnapshot(src.SideSnapshot);
                }
            }

            GUILayout.Label("References", DeGUI.styles.label.bold);
            src.Bg          = EditorGUILayout.ObjectField("Bg", src.Bg, typeof(Button), true) as Button;
            src.BtContinue  = EditorGUILayout.ObjectField("BT Continue", src.BtContinue, typeof(Button), true) as Button;
            src.BtRetry     = EditorGUILayout.ObjectField("BT Retry", src.BtRetry, typeof(Button), true) as Button;
            src.IcoContinue = EditorGUILayout.ObjectField("Ico Continue", src.IcoContinue, typeof(RectTransform), true) as RectTransform;
        }
Esempio n. 4
0
 public override void OnInspectorGUI()
 {
     DeGUI.BeginGUI(ABSAnimationInspector.colors, ABSAnimationInspector.styles);
 }
 // Methods
 public override void OnInspectorGUI()
 {
     DeGUI.BeginGUI(colors, styles);
 }
Esempio n. 6
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            DeAudioClipDataModeAttribute options = drawMode == null ? _DefDrawMode : drawMode;

            EditorGUI.BeginProperty(position, label, property);
            DeGUI.BeginGUI();
            int orIndent = EditorGUI.indentLevel;

            float lineH       = EditorGUIUtility.singleLineHeight;
            float btW         = 22;
            float btLoopW     = 44;
            float groupW      = 78;
            Rect  clipRect    = new Rect(position.x, position.y, position.width - groupW - 4, lineH);
            Rect  groupIdRect = new Rect(position.x + (position.width - groupW), clipRect.y, groupW, lineH);
            Rect  volumeRect  = new Rect(position.x, position.y + lineH + 1, position.width - btW * 2 - 4, lineH);
            Rect  btPlayRect  = new Rect(position.x + (position.width - btW * 2), volumeRect.y - 1, btW, lineH);
            Rect  btStopRect  = new Rect(position.x + (position.width - btW), volumeRect.y - 1, btW, lineH);
            Rect  pitchRect   = new Rect(position.x, volumeRect.y + lineH, position.width - btLoopW - 4, lineH);
            Rect  btLoopRect  = new Rect(position.x + (position.width - btLoopW), pitchRect.y + 1, btLoopW, lineH - 2);

            switch (options.mode)
            {
            case DeAudioClipGUIMode.ClipOnly:
            case DeAudioClipGUIMode.FullNoGroup:
                clipRect.width = position.width;
                break;

            case DeAudioClipGUIMode.CompactPreviewOnly:
                clipRect.width = position.width - btW * 2 - 4;
                btPlayRect.y   = btStopRect.y = position.y;
                break;

            case DeAudioClipGUIMode.CompactWithGroupAndPreview:
                clipRect.width -= btW * 2 + 2;
                groupIdRect.x  -= btW * 2 + 2;
                btPlayRect.y    = btStopRect.y = position.y;
                break;

            case DeAudioClipGUIMode.VolumeAndLoopsWithPreview:
                volumeRect.width -= btW * 2 + 8;
                btLoopRect.x     -= btW * 2 + 7;
                btLoopRect.y      = volumeRect.y + 1;
                break;
            }

            // Clip
            SerializedProperty clip = property.FindPropertyRelative("clip");

            using (new DeGUI.ColorScope(clip.objectReferenceValue == null ? Color.yellow : Color.white)) {
                EditorGUI.PropertyField(clipRect, clip, label);
            }
            if (options.mode != DeAudioClipGUIMode.ClipOnly)
            {
                if (options.mode != DeAudioClipGUIMode.CompactPreviewOnly && options.mode != DeAudioClipGUIMode.FullNoGroup)
                {
                    // Group
                    using (new EditorGUI.DisabledScope(!options.allowGroupChange)) {
                        EditorGUI.PropertyField(groupIdRect, property.FindPropertyRelative("groupId"), new GUIContent(""));
                    }
                }
                // Volume
                bool hasVolume = options.mode == DeAudioClipGUIMode.Full ||
                                 options.mode == DeAudioClipGUIMode.VolumeWithPreview ||
                                 options.mode == DeAudioClipGUIMode.VolumeAndLoopsWithPreview;
                if (hasVolume)
                {
                    SerializedProperty volumeProp = property.FindPropertyRelative("volume");
                    float prevVolume = volumeProp.floatValue;
                    EditorGUI.Slider(volumeRect, volumeProp, 0, 1, "└ Volume");
                    if (Math.Abs(volumeProp.floatValue - prevVolume) > float.Epsilon)
                    {
                        AdjustVolume(property, volumeProp.floatValue);
                    }
                }
                if (options.mode == DeAudioClipGUIMode.Full)
                {
                    // Pitch
                    SerializedProperty pitchProp = property.FindPropertyRelative("pitch");
                    float prevPitch = pitchProp.floatValue;
                    EditorGUI.Slider(pitchRect, pitchProp, 0, 3, "└ Pitch");
                    if (Math.Abs(pitchProp.floatValue - prevPitch) > float.Epsilon)
                    {
                        AdjustPitch(property, pitchProp.floatValue);
                    }
                }
                if (options.mode != DeAudioClipGUIMode.Compact)
                {
                    // Controls
                    if (GUI.Button(btPlayRect, "►", DeGUI.styles.button.tool))
                    {
                        Play(property);
                    }
                    if (GUI.Button(btStopRect, "■", DeGUI.styles.button.tool))
                    {
                        Stop(property);
                    }
                }
                if (options.mode == DeAudioClipGUIMode.Full || options.mode == DeAudioClipGUIMode.VolumeAndLoopsWithPreview)
                {
                    // Loop
                    SerializedProperty loopProp = property.FindPropertyRelative("loop");
                    loopProp.boolValue = DeGUI.ToggleButton(btLoopRect, loopProp.boolValue, "Loop", DeGUI.styles.button.bBlankBorderCompact);
                }
            }

            EditorGUI.indentLevel = orIndent;
            EditorGUI.EndProperty();
        }