Esempio n. 1
0
        private VisualElement GetSceneObjetsOrderElement()
        {
            var foldout = new Foldout
            {
                text = "Scene objects order", value = false, contentContainer = { style = { marginLeft = 5 } }
            };

            if (GFSystemUtility.GetSystemOrder(target as Setup))
            {
                LoadLocal();
            }
            else
            {
                LoadBase();
            }

            void LoadBase()
            {
                foldout.Clear();

                foldout.Add(new Button(LoadLocal)
                {
                    text = "Add local data"
                });

                var local = GFSystemUtility.GetSystemOrder(target as Setup);

                if (local)
                {
                    GFSystemUtility.RemoveSystemOrder(target as Setup);
                }
            }

            void LoadLocal()
            {
                foldout.Clear();
                var local = GFSystemUtility.GetSystemOrder(target as Setup);

                if (!local)
                {
                    local = GFSystemUtility.AddSystemOrder(target as Setup);
                }


                foldout.Add(new Button(LoadBase)
                {
                    text = "Remove local data"
                });

                var element = new InspectorElement(local);

                foldout.Add(element);
            }

            return(foldout);
        }