示例#1
0
        public void DrawControl(IAudioEffectPlugin plugin)
        {
            if (loudness == null)
            {
                loudness = new AudioSignalSmoothAnalyzer();
            }

            if (_loudnessTree == null)
            {
                _loudnessTree = PropertyTree.Create(loudness);
            }

            plugin.GetFloatParameter("Instance", out var instance);

            var i = GAC.ChannelMonitor_GetLoudnessData_dB((int)instance);

            loudness.Add(GAC.dBToNormalized(i));

            var guie = GUI.enabled;

            GUI.enabled = true;
            _loudnessTree.Draw(false);
            _loudnessTree.ApplyChanges();
            GUI.enabled = guie;
        }
            private void DrawBaseEditor()
            {
#if ODIN_INSPECTOR
                _propertyTree?.Draw();
                _propertyTree?.ApplyChanges();
#else
                base.OnInspectorGUI();
#endif
            }
示例#3
0
 public void Draw()
 {
     try {
         FilterRules(_searchFilter);
         _drawerTree.Draw();
         ApplyChanges();
     }
     catch (Exception e) {
         Debug.LogError(e);
     }
 }
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginDisabledGroup(true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script"));
            EditorGUI.EndDisabledGroup();
#if ODIN_INSPECTOR
            if (propertyTree != null)
            {
#if ODIN_INSPECTOR_3
                propertyTree.BeginDraw(true);
                propertyTree.Draw();
                propertyTree.EndDraw();
#else
                Sirenix.OdinInspector.Editor.InspectorUtilities.BeginDrawPropertyTree(propertyTree, true);
                propertyTree.Draw();
                Sirenix.OdinInspector.Editor.InspectorUtilities.EndDrawPropertyTree(propertyTree);
#endif
            }
#else
            EditorGUI.BeginChangeCheck();
            SerializedProperty iterator = serializedObject.GetIterator();
            iterator.NextVisible(true);
            do
            {
                if (iterator.name == "m_Script")
                {
                    continue;
                }
                EditorGUILayout.PropertyField(iterator);
            } while (iterator.NextVisible(false));

            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
            }
            serializedObject.Update();
#endif
        }
        protected override void CreateInspector()
        {
#if ODIN_INSPECTOR
            var imGuiContainer = new IMGUIContainer(() => _propertyTree.Draw());
            root.Add(imGuiContainer);
            return;
#endif
            base.CreateInspector();

            root.Add(new Button(() => ScriptableGameFlowWindow.ShowWindow(target as GameFlowGraph))
            {
                text = "Open Game Flow"
            });
        }
        /// <summary>
        /// 绘制用于Example创建的UI
        /// </summary>
        private void DrawExampleCreatorEditor()
        {
            if (m_ExamplePropertyTree == null)
            {
                if (m_ExampleTemplate == null)
                {
                    m_ExampleTemplate = new ExampleTemplate();
                }

                m_ExamplePropertyTree = PropertyTree.Create(m_ExampleTemplate);
            }

            GUILayout.Label("自动生成OverViewExample代码", SirenixGUIStyles.SectionHeader, new GUILayoutOption[0]);

            SirenixEditorGUI.DrawThickHorizontalSeparator(4f, 10f);
            m_ExamplePropertyTree.Draw(false);
        }
        private bool DrawWithOdin()
        {
            var hasOdinAsset = false;

#if ODIN_INSPECTOR_3
            hasOdinAsset = true;
#endif
            if (!hasOdinAsset)
            {
                return(false);
            }

#if ODIN_INSPECTOR
            _propertyTree?.Draw();
            _propertyTree?.ApplyChanges();
#endif

            return(true);
        }
示例#8
0
 public void Draw() => _drawer?.Draw(false);