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(); } }
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); }