示例#1
0
 private void OnDoubleClick()
 {
     if (this.list.index >= 0 && this.list.index < this.targetBloxCache.Count)
     {
         BloxEditorWindow.Show_BloxEditorWindow(this.targetBloxCache[this.list.index]);
     }
 }
示例#2
0
        public void DrawBloxList()
        {
            int num = plyEdGUI.List <Blox>(ref this.selectedBloxIdx, BloxEd.BloxGlobalObj.bloxDefs, ref this.scroll, this.listOps, new GUILayoutOption[0]);

            switch (num)
            {
            case 1:
                if (BloxEdGlobal.DoubleClickOpenBloxDef)
                {
                    break;
                }
                goto case 2;

            case 2:
                if (this.selectedBloxIdx >= 0 && this.selectedBloxIdx < BloxEd.BloxGlobalObj.bloxDefs.Count)
                {
                    BloxEditorWindow.Show_BloxEditorWindow(BloxEd.BloxGlobalObj.bloxDefs[this.selectedBloxIdx]);
                }
                return;
            }
            if (num >= 3)
            {
                num -= 3;
                plyEdGUI.ClearFocus();
                DragAndDrop.PrepareStartDrag();
                DragAndDrop.objectReferences = new Object[0];
                DragAndDrop.paths            = null;
                DragAndDrop.SetGenericData("BloxDefinition", BloxEd.BloxGlobalObj.bloxDefs[num]);
                DragAndDrop.StartDrag(BloxEd.BloxGlobalObj.bloxDefs[num].screenName);
                Event.current.Use();
            }
        }
示例#3
0
        protected void OnEnable()
        {
            Debug.Log("OnEnable", "BloxListWindow", UnityEngine.Color.yellow);
            BloxListWindow.Instance = this;
            Texture2D image = plyEdGUI.LoadTextureResource("BloxEditor.res.icons.blox_mono" + (plyEdGUI.IsDarkSkin() ? "_p" : "") + ".png", typeof(BloxListWindow).Assembly, FilterMode.Point, TextureWrapMode.Clamp);

            base.titleContent = new GUIContent("BloxDefs", image);
            BloxEd.LoadBloxGlobal();
            if (this.listOps == null)
            {
                this.listOps = new plyEdGUI.ListOps
                {
                    emptyMsg       = "No Blox defined",
                    drawBackground = false,
                    onDrawElement  = this.DrawElement,
                    onAction       = this.ListAction,
                    extraButtons   = new plyEdGUI.ListOpsExtraToolbarButton[2]
                    {
                        new plyEdGUI.ListOpsExtraToolbarButton
                        {
                            label    = new GUIContent(Ico._rename, "Rename selected Blox Definition"),
                            callback = delegate
                            {
                                plyTextInputWiz.ShowWiz("Rename Blox", "", BloxEd.BloxGlobalObj.bloxDefs[this.selectedBloxIdx].screenName, this.OnRenameBloxDef, null, 250f);
                            },
                            enabled = (() => this.selectedBloxIdx >= 0)
                        },
                        new plyEdGUI.ListOpsExtraToolbarButton
                        {
                            label    = new GUIContent(Ico._blox + "Edit", "Edit in Blox Editor"),
                            callback = delegate
                            {
                                BloxEditorWindow.Show_BloxEditorWindow(BloxEd.BloxGlobalObj.bloxDefs[this.selectedBloxIdx]);
                            },
                            enabled = (() => this.selectedBloxIdx >= 0)
                        }
                    },
                    canAdd            = true,
                    canDuplicate      = false,
                    canRemove         = true,
                    canChangePosition = false,
                    addLabel          = BloxListWindow.GC_Add,
                    removeLabel       = BloxListWindow.GC_Remove,
                    duplicateLabel    = BloxListWindow.GC_Duplicate
                };
            }
        }
示例#4
0
 private void OnSelectBlox()
 {
     this.activeVars   = null;
     this.selectedBlox = this.targetBloxCache[this.list.index];
     if ((UnityEngine.Object) this.selectedBlox != (UnityEngine.Object)null)
     {
         if (this.selectedBlox.variables.varDefs.Count == 0)
         {
             this.selectedBlox.variables.Serialize();
             this.selectedBlox.variables.Deserialize(false);
         }
         BloxContainerInspector.GC_VarsHead.text = "Variables of: " + this.selectedBlox.screenName;
         this.activeVars = this.Target.GetBloxVariables(this.selectedBlox.ident, this.selectedBlox);
         this.activeVars._SetDirty();
         this.Save();
         this.varEditor.SetTarget(this.activeVars, this.Target.gameObject);
         base.Repaint();
     }
     if (!BloxEdGlobal.DoubleClickOpenBloxDef && this.list.index >= 0 && this.list.index < this.targetBloxCache.Count)
     {
         BloxEditorWindow.Show_BloxEditorWindow(this.targetBloxCache[this.list.index]);
     }
 }