protected override void DoOnExplorerSelectionChange(IItem item)
        {
            World world = item as World;

            if (world == null)
            {
                return;
            }

            _gateView.UpdateDisplayItem(world.Gate);

            world.RefreshSubWorlds();
            _subWorldListAdaptor = new GenericClassListAdaptor <World>(world.SubWorlds, 20,
                                                                       () => { return(new World()); },
                                                                       (position, theItem, index) =>
            {
                var size = GUI.skin.GetStyle("label").CalcSize(new GUIContent(theItem.ID));
                GUI.Label(new Rect(position.x, position.y, size.x, position.height), theItem.ID);
                if (GUI.Button(new Rect(position.x + size.x + 10, position.y, 50, position.height), "Edit"))
                {
                    _treeExplorer.SelectItem(theItem);
                }
                return(theItem);
            });
            _scoreListAdaptor = new GenericClassListAdaptor <Score>(world.Scores, 20,
                                                                    () => { return(new Score()); },
                                                                    (position, theItem, index) =>
            {
                var size = GUI.skin.GetStyle("label").CalcSize(new GUIContent(theItem.ID));
                GUI.Label(new Rect(position.x, position.y, size.x, position.height), theItem.ID);
                if (GUI.Button(new Rect(position.x + size.x + 10, position.y, 50, position.height), "Edit"))
                {
                    ScoreTreeExplorer scoreTreeExplorer = (GameKitEditorWindow.GetInstance().GetTreeExplorer(
                                                               GameKitEditorWindow.TabType.Scores) as ScoreTreeExplorer);
                    GameKitEditorWindow.GetInstance().SelectTab(GameKitEditorWindow.TabType.Scores);
                    scoreTreeExplorer.SelectItem(theItem);
                }
                return(theItem);
            });
            _missionListAdaptor = new GenericClassListAdaptor <Mission>(world.Missions, 20,
                                                                        () => { return(new Mission()); },
                                                                        (position, theItem, index) =>
            {
                var size = GUI.skin.GetStyle("label").CalcSize(new GUIContent(theItem.ID));
                GUI.Label(new Rect(position.x, position.y, size.x, position.height), theItem.ID);
                if (GUI.Button(new Rect(position.x + size.x + 10, position.y, 50, position.height), "Edit"))
                {
                    MissionTreeExplorer missionTreeExplorer = (GameKitEditorWindow.GetInstance().GetTreeExplorer(
                                                                   GameKitEditorWindow.TabType.Missions) as MissionTreeExplorer);
                    GameKitEditorWindow.GetInstance().SelectTab(GameKitEditorWindow.TabType.Missions);
                    missionTreeExplorer.SelectItem(theItem);
                }
                return(theItem);
            });
        }
        private void OnRemoveScore(object sender, ItemRemovingEventArgs args)
        {
            GenericClassListAdaptor <Score> listAdaptor = args.adaptor as GenericClassListAdaptor <Score>;
            Score score = listAdaptor[args.itemIndex];

            if (listAdaptor != null)
            {
                ScorePropertyInspector scoreInspector = GameKitEditorWindow.GetInstance().GetPropertyInsepctor(
                    GameKitEditorWindow.TabType.Scores) as ScorePropertyInspector;
                IItem[] items = scoreInspector.GetAffectedItems(score.ID);
                if (items.Length > 0)
                {
                    EditorUtility.DisplayDialog("Warning", "Not allowed to delete becase the item is still used by following items: " +
                                                scoreInspector.GetAffectedItemsWarningString(items), "OK");
                    args.Cancel = true;
                }
                else
                {
                    if (EditorUtility.DisplayDialog("Confirm to delete",
                                                    "Confirm to delete score [" + score.ID + "]?", "OK", "Cancel"))
                    {
                        args.Cancel = false;
                        GameKit.Config.UpdateMapsAndTree();
                        GameKitEditorWindow.GetInstance().Repaint();

                        ScoreTreeExplorer scoreTreeExplorer = GameKitEditorWindow.GetInstance().GetTreeExplorer(
                            GameKitEditorWindow.TabType.Scores) as ScoreTreeExplorer;
                        if (scoreTreeExplorer.CurrentSelectedItem == score)
                        {
                            scoreTreeExplorer.SelectItem(null);
                        }
                    }
                    else
                    {
                        args.Cancel = true;
                    }
                }
            }
        }