示例#1
0
        internal static void CreatePropertyGridView()
        {
            EditorHandler.PropertyGridContainer.Children.Clear();

            // TODO: handle multiple selection
            if (EditorHandler.SelectedGameObjects.Count == 1)
            {
                PropertyBox properties;

                properties = new PropertyBox();

                properties.SelectedObject      = EditorHandler.SelectedGameObjects[0] as GameObject;
                EditorHandler.SelectedObjectPG = properties.PropertyGrid;
                properties.ToggleExpand();

                EditorHandler.PropertyGridContainer.Children.Add(properties);

                if (EditorHandler.SelectedGameObjects[0] is GameObject)
                {
                    foreach (ObjectComponent component in EditorHandler.SelectedGameObjects[0].GetComponents())
                    {
                        properties = new PropertyBox();
                        properties.SelectedObject = component;
                        properties.Title.Content += " (Component)";

                        if (component.EditorExpanded)
                        {
                            properties.ToggleExpand();
                        }

                        EditorHandler.PropertyGridContainer.Children.Add(properties);
                    }
                }
            }
        }
示例#2
0
        //internal static OutputWindow OutputWindow = new OutputWindow();

        /// <summary>
        /// Changes the property grid and property label to the input value
        /// </summary>
        /// <param name="value">The object</param>
        public static void ChangeSelectedObject(object value)
        {
            if (value != null)
            {
                EditorHandler.PropertyGridContainer.Children.Clear();
                PropertyBox properties;
                properties = new PropertyBox();
                properties.SelectedObject = value;
                properties.ToggleExpand();

                EditorHandler.PropertyGridContainer.Children.Add(properties);
            }
        }
示例#3
0
        //internal static OutputWindow OutputWindow = new OutputWindow();

        /// <summary>
        /// Changes the property grid and property label to the input value
        /// </summary>
        /// <param name="value">The object</param>
        public static void ChangeSelectedObject(object value)
        {
            if (value != null)
            {
                EditorHandler.PropertyGridContainer.Children.Clear();
                PropertyBox properties;
                properties = new PropertyBox();
                properties.SelectedObject = value;
                properties.ToggleExpand();

                EditorHandler.PropertyGridContainer.Children.Add(properties);
            }
        }
示例#4
0
        internal static void CreatePropertyGridView()
        {
            EditorHandler.PropertyGridContainer.Children.Clear();

            if (EditorHandler.SelectedGameObjects.Count > 0)
            {
                PropertyBox properties;

                properties = new PropertyBox();

                properties.SelectedObject = EditorHandler.SelectedGameObjects[0] as GameObject;
                EditorHandler.SelectedObjectPG = properties.PropertyGrid;
                properties.ToggleExpand();

                EditorHandler.PropertyGridContainer.Children.Add(properties);

                for (int i = 0; i < EditorHandler.SelectedGameObjects.Count; i++)
                {
                    if (EditorHandler.SelectedGameObjects[i] is GameObject)
                    {
                        foreach (ObjectComponent component in EditorHandler.SelectedGameObjects[i].GetComponents())
                        {
                            properties = new PropertyBox();
                            properties.SelectedObject = component;
                            properties.Title.Content += " (Component)";

                            if (component.EditorExpanded)
                                properties.ToggleExpand();

                            EditorHandler.PropertyGridContainer.Children.Add(properties);
                        }
                    }
                }
            }
        }