Esempio n. 1
0
        protected override void DoubleClickedItem(int id)
        {
            BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem = base.FindItem(id, base.rootItem) as BuildPlayerSceneTreeViewItem;
            int mainAssetOrInProgressProxyInstanceID = AssetDatabase.GetMainAssetOrInProgressProxyInstanceID(buildPlayerSceneTreeViewItem.fullName);

            EditorGUIUtility.PingObject(mainAssetOrInProgressProxyInstanceID);
        }
Esempio n. 2
0
 public EditorBuildSettingsScene[] GetSceneList()
 {
     EditorBuildSettingsScene[] array = new EditorBuildSettingsScene[base.rootItem.children.Count];
     for (int i = 0; i < base.rootItem.children.Count; i++)
     {
         BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem = base.rootItem.children[i] as BuildPlayerSceneTreeViewItem;
         array[i] = new EditorBuildSettingsScene(buildPlayerSceneTreeViewItem.fullName, buildPlayerSceneTreeViewItem.active);
     }
     return(array);
 }
Esempio n. 3
0
        protected override TreeViewItem BuildRoot()
        {
            TreeViewItem treeViewItem = new TreeViewItem(-1, -1);

            treeViewItem.children = new List <TreeViewItem>();
            List <EditorBuildSettingsScene> list = new List <EditorBuildSettingsScene>(EditorBuildSettings.scenes);

            foreach (EditorBuildSettingsScene current in list)
            {
                BuildPlayerSceneTreeViewItem child = new BuildPlayerSceneTreeViewItem(current.guid.GetHashCode(), 0, current.path, current.enabled);
                treeViewItem.AddChild(child);
            }
            return(treeViewItem);
        }
        protected override TreeViewItem BuildRoot()
        {
            var root = new TreeViewItem(-1, -1);

            root.children = new List <TreeViewItem>();

            List <EditorBuildSettingsScene> scenes = new List <EditorBuildSettingsScene>(EditorBuildSettings.scenes);

            foreach (var sc in scenes)
            {
                var item = new BuildPlayerSceneTreeViewItem(sc.guid.GetHashCode(), 0, sc.guid, sc.enabled);
                root.AddChild(item);
            }
            return(root);
        }
Esempio n. 5
0
        protected override void RowGUI(TreeView.RowGUIArgs args)
        {
            BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem = args.item as BuildPlayerSceneTreeViewItem;

            if (buildPlayerSceneTreeViewItem != null)
            {
                bool flag = !buildPlayerSceneTreeViewItem.guid.Empty() && File.Exists(buildPlayerSceneTreeViewItem.fullName);
                using (new EditorGUI.DisabledScope(!flag))
                {
                    bool flag2 = buildPlayerSceneTreeViewItem.active;
                    if (!flag)
                    {
                        flag2 = false;
                    }
                    flag2 = GUI.Toggle(new Rect(args.rowRect.x, args.rowRect.y, 16f, 16f), flag2, "");
                    if (flag2 != buildPlayerSceneTreeViewItem.active)
                    {
                        if (base.GetSelection().Contains(buildPlayerSceneTreeViewItem.id))
                        {
                            IList <int> selection = base.GetSelection();
                            foreach (int current in selection)
                            {
                                BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem2 = base.FindItem(current, base.rootItem) as BuildPlayerSceneTreeViewItem;
                                buildPlayerSceneTreeViewItem2.active = flag2;
                            }
                        }
                        else
                        {
                            buildPlayerSceneTreeViewItem.active = flag2;
                        }
                        EditorBuildSettings.scenes = this.GetSceneList();
                    }
                    base.RowGUI(args);
                    if (buildPlayerSceneTreeViewItem.counter != BuildPlayerSceneTreeViewItem.kInvalidCounter)
                    {
                        TreeView.DefaultGUI.LabelRightAligned(args.rowRect, "" + buildPlayerSceneTreeViewItem.counter, args.selected, args.focused);
                    }
                    else if (buildPlayerSceneTreeViewItem.displayName == string.Empty || !flag)
                    {
                        TreeView.DefaultGUI.LabelRightAligned(args.rowRect, "Deleted", args.selected, args.focused);
                    }
                }
            }
            else
            {
                base.RowGUI(args);
            }
        }
Esempio n. 6
0
        protected override void BeforeRowsGUI()
        {
            int num = 0;

            foreach (TreeViewItem current in base.rootItem.children)
            {
                BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem = current as BuildPlayerSceneTreeViewItem;
                if (buildPlayerSceneTreeViewItem != null)
                {
                    buildPlayerSceneTreeViewItem.UpdateName();
                }
                if (buildPlayerSceneTreeViewItem.active)
                {
                    buildPlayerSceneTreeViewItem.counter = num;
                    num++;
                }
                else
                {
                    buildPlayerSceneTreeViewItem.counter = BuildPlayerSceneTreeViewItem.kInvalidCounter;
                }
            }
            base.BeforeRowsGUI();
        }