protected void PropertyField(SerializedProperty property)
        {
            Assert.IsNotNull(property);
            var title = ChartEditorHelper.GetContent(property.displayName);

            PropertyField(property, title);
        }
Beispiel #2
0
        private void AddComponent()
        {
            if (GUILayout.Button(Styles.btnAddComponent))
            {
                var menu = new GenericMenu();
                foreach (var type in GetMainComponentTypeNames())
                {
                    var  title  = ChartEditorHelper.GetContent(type.Name);
                    bool exists = !m_Chart.CanAddChartComponent(type);
                    if (!exists)
                    {
                        menu.AddItem(title, false, () =>
                        {
                            m_ComponentList.AddChartComponent(type);
                        });
                    }
                    else
                    {
                        menu.AddDisabledItem(title);
                    }
                }

                menu.ShowAsContext();
            }
        }
        protected SerializedProperty PropertyField(string path)
        {
            Assert.IsNotNull(path);
            var property = FindProperty(path);

            Assert.IsNotNull(property, "Can't find:" + path);
            var title = ChartEditorHelper.GetContent(property.displayName);

            PropertyField(property, title);
            return(property);
        }
        protected void PropertyField(string path)
        {
            var property = FindProperty(path);

            if (property != null)
            {
                var title = ChartEditorHelper.GetContent(property.displayName);
                PropertyField(property, title);
            }
            else
            {
                Debug.LogError("Property not exist:" + baseProperty.propertyPath + "," + path);
            }
        }
Beispiel #5
0
 private void AddSerie()
 {
     if (GUILayout.Button(Styles.btnAddSerie))
     {
         var menu = new GenericMenu();
         foreach (var type in GetSerieTypeNames())
         {
             var title = ChartEditorHelper.GetContent(type.Name);
             if (m_Chart.CanAddSerie(type))
             {
                 menu.AddItem(title, false, () =>
                 {
                     m_SerieList.AddSerie(type);
                 });
             }
             else
             {
                 menu.AddDisabledItem(title);
             }
         }
         menu.ShowAsContext();
     }
 }