Exemplo n.º 1
0
        private void AddNewBloxDef()
        {
            Blox blox = BloxEd.CreateNewBloxDef();

            this.Target.bloxIdents.Add(blox.ident);
            this.targetBloxCache.Add(blox);
            this.Save();
            BloxListWindow instance = BloxListWindow.Instance;

            if ((object)instance != null)
            {
                instance.Repaint();
            }
        }
Exemplo n.º 2
0
        private int ListAction(plyEdGUI.ListOps.ListAction act)
        {
            switch (act)
            {
            case plyEdGUI.ListOps.ListAction.DoAdd:
                BloxEd.CreateNewBloxDef();
                this.selectedBloxIdx = -1;
                break;

            case plyEdGUI.ListOps.ListAction.DoRemoveSelected:
                if (EditorUtility.DisplayDialog("Blox", "Delete Blox Definition. This can't be undone. Are you sure?", "Yes", "Cancel"))
                {
                    BloxEd.DeleteBloxDef(BloxEd.BloxGlobalObj.bloxDefs[this.selectedBloxIdx]);
                    BloxEditorWindow instance = BloxEditorWindow.Instance;
                    if ((object)instance != null)
                    {
                        instance.Repaint();
                    }
                    plyEdUtil.RepaintInspector(typeof(BloxContainer));
                }
                break;
            }
            return(-1);
        }