Ejemplo n.º 1
0
 public Item(ItemArgs args)
 {
     this.Name    = args.Name;
     this.cost    = args.cost;
     this.graphic = args.graphic;
     this.weight  = args.weight;
 }
Ejemplo n.º 2
0
        private void OnItemDoubleClick(object sender, ItemArgs args)
        {
            FsEntry entry      = (FsEntry)args.Items[0];
            string  currentDir = CurrentDir;

            currentDir = NormalizePath(currentDir);

            switch (entry.EntryType)
            {
            case FsEntryType.Up:
                currentDir = Directory.GetParent(CurrentDir).ToString();
                break;

            case FsEntryType.Directory:
                currentDir = entry.Path;
                break;
            }

            CurrentDir = currentDir;

            if (entry.EntryType != FsEntryType.Up)
            {
                if (DoubleClick != null)
                {
                    DoubleClick(entry.Path);
                }
            }
        }
 private void OnItemDoubleClick(object sender, ItemArgs e)
 {
     if (m_parentDialog != null)
     {
         m_parentDialog.Close(true);
     }
 }
Ejemplo n.º 4
0
    public override void Execute(object data)
    {
        ItemArgs   e      = data as ItemArgs;
        PlayerMove player = GetView <PlayerMove>();
        GameModel  gm     = GetModel <GameModel>();
        UIBoard    ui     = GetView <UIBoard>();

        switch (e.kind)
        {
        case ItemKind.invincibleItem:
            player.HitInvincible();
            ui.HitInvincible();
            gm.m_Invincible -= e.count;
            break;

        case ItemKind.multipleItem:
            player.HitMultiply();
            ui.HitMultiply();
            gm.m_Multiple -= e.count;
            break;

        case ItemKind.magnetItem:
            player.HitMagnet();
            ui.HitMagnet();
            gm.m_Magnet -= e.count;
            break;
        }
        ui.UpdateUI();
    }
Ejemplo n.º 5
0
 protected virtual void OnItemEndDrag(object sender, ItemArgs e)
 {
     if (Editor.DragDrop.InProgress)
     {
         Editor.DragDrop.RaiseDrop(e.PointerEventData);
     }
 }
Ejemplo n.º 6
0
 private void OnItemDoubleClick(object sender, ItemArgs e)
 {
     if (DoubleClick != null)
     {
         DoubleClick(this, new ProjectResourcesEventArgs(e.Items.OfType <ProjectItemObjectPair>().ToArray()));
     }
 }
Ejemplo n.º 7
0
    public override void Execute(object data)
    {
        ItemArgs   e       = data as ItemArgs;
        PlayerMove player  = MVC.GetView <PlayerMove>();
        UIBoard    uiBoard = MVC.GetView <UIBoard>();

        switch (e.M_Kind)
        {
        case ItemKind.ItemMagnet:
            player.HitMagnet();
            Game.M_Instance.M_GM.M_Magnet -= e.M_HitCount;
            uiBoard.HitMagnet();
            break;

        case ItemKind.ItemMultiply:
            player.HitMultiply();
            Game.M_Instance.M_GM.M_Multiply -= e.M_HitCount;
            uiBoard.HitMultiply();
            break;

        case ItemKind.ItemInvincible:
            player.HitInvincible();
            Game.M_Instance.M_GM.M_Invincible -= e.M_HitCount;
            uiBoard.HitInvincible();
            break;
        }
        uiBoard.UpdateUI();
    }
 private void OnItemDoubleClick(object sender, ItemArgs e)
 {
     if (ItemDoubleClick != null)
     {
         ItemDoubleClick(this, new ProjectTreeEventArgs(e.Items.OfType <ProjectItem>().ToArray()));
     }
 }
Ejemplo n.º 9
0
    public override void Execute(object data)
    {
        ItemArgs   e      = data as ItemArgs;
        PlayerMove Player = GetView <PlayerMove>();
        GameModel  gm     = GetModel <GameModel>();
        UIBoard    ui     = GetView <UIBoard>();

        switch (e.itemkind)
        {
        case ItemKind.InvincibleItem:
            gm.m_Invincible -= e.itemCount;
            Player.HitInvincible();
            ui.HitInvincible();
            break;

        case ItemKind.MagnetItem:
            gm.m_Magnet -= e.itemCount;
            Player.HitMagnet();
            ui.HitMagnet();
            break;

        case ItemKind.MultiplyItem:
            gm.m_Multiply -= e.itemCount;
            Player.HitDouble();
            ui.HitDouble();
            break;

        default:
            break;
        }
        ui.UpdateUI();
    }
Ejemplo n.º 10
0
    public override void Execute(object data = null)
    {
        ItemArgs  e  = data as ItemArgs;
        GameModel gm = GetModel <GameModel>();

        PlayerMove player  = GetView <PlayerMove>();
        UIBoard    uiBoard = GetView <UIBoard>();

        switch (e.itemtype)
        {
        case ItemType.ItemInvincible:
            player.HitInvincible();
            gm.Invincible -= e.hitCount;
            uiBoard.HitInvincible();
            break;

        case ItemType.ItemMultiply:
            player.HitMutiply();
            gm.Multiply -= e.hitCount;
            uiBoard.HitMutiply();
            break;

        case ItemType.ItemMagnet:
            player.HitMagnet();
            gm.Magnet -= e.hitCount;
            uiBoard.HitMagnet();
            break;

        case ItemType.ItemAddTime:
            player.HitAddTime();
            break;
        }
        uiBoard.UpdateUI();
    }
Ejemplo n.º 11
0
        private void OnItemClick(object sender, ItemArgs e)
        {
            if (e.PointerEventData.button == PointerEventData.InputButton.Right)
            {
                IContextMenu menu = IOC.Resolve <IContextMenu>();

                MenuItemInfo createFolder = new MenuItemInfo {
                    Path = "Create Folder"
                };
                createFolder.Action = new MenuItemEvent();
                createFolder.Action.AddListener(CreateFolder);

                MenuItemInfo deleteFolder = new MenuItemInfo {
                    Path = "Delete"
                };
                deleteFolder.Action = new MenuItemEvent();
                deleteFolder.Action.AddListener(DeleteFolder);

                MenuItemInfo renameFolder = new MenuItemInfo {
                    Path = "Rename"
                };
                renameFolder.Action = new MenuItemEvent();
                renameFolder.Action.AddListener(RenameFolder);

                menu.Open(new[]
                {
                    createFolder,
                    deleteFolder,
                    renameFolder
                });
            }
        }
Ejemplo n.º 12
0
    public void HitItem(ItemKind item)
    {
        ItemArgs e = new ItemArgs
        {
            itemkind  = item,
            itemCount = 0
        };

        SendEvent(Const.E_HitItem, e);

        //switch (item)
        //{
        //    case ItemKind.InvincibleItem:
        //        HitInvincible();
        //        break;
        //    case ItemKind.MagnetItem:
        //        HitMagnet();
        //        break;
        //    case ItemKind.MultiplyItem:
        //        HitDouble();
        //        break;
        //    default:
        //        break;
        //}
    }
Ejemplo n.º 13
0
 private void OnItemDoubleClick(object sender, ItemArgs e)
 {
     if (e.PointerEventData.button == PointerEventData.InputButton.Left)
     {
         ProjectItem projectItem = (ProjectItem)e.Items[0];
         Toggle(projectItem);
     }
 }
Ejemplo n.º 14
0
    public void OnMultipleClick()
    {
        ItemArgs e = new ItemArgs()
        {
            count = 1, kind = ItemKind.multipleItem
        };

        SendEvent(Consts.E_HitItem, e);
    }
Ejemplo n.º 15
0
    public void OnInvincibleClick()
    {
        ItemArgs e = new ItemArgs()
        {
            count = 1, kind = ItemKind.invincibleItem
        };

        SendEvent(Consts.E_HitItem, e);
    }
Ejemplo n.º 16
0
    /// <summary>
    /// Magnet
    /// </summary>
    public void OnMagnetClick()
    {
        ItemArgs e = new ItemArgs()
        {
            count = 1, kind = ItemKind.magnetItem
        };

        SendEvent(Consts.E_HitItem, e);
    }
Ejemplo n.º 17
0
        private void OnItemClick(object sender, ItemArgs e)
        {
            ToolCmd cmd = (ToolCmd)e.Items[0];

            if (cmd.Validate())
            {
                cmd.Run();
            }
        }
Ejemplo n.º 18
0
    public void HitItem(ItemKind item)
    {
        ItemArgs e = new ItemArgs
        {
            M_Kind     = item,
            M_HitCount = 0
        };

        MVC.SendEvent(Consts.E_HitItemController, e);
    }
Ejemplo n.º 19
0
        private void OnItemDoubleClicked(object sender, ItemArgs e)
        {
            ExposeToEditor exposeToEditor = (ExposeToEditor)e.Items[0];

            if (exposeToEditor.CanSelect)
            {
                Editor.Selection.activeObject = exposeToEditor.gameObject;
                ItemDoubleClick.Invoke();
            }
        }
Ejemplo n.º 20
0
    //处理碰到奖励物品
    public void HitItem(ItemType item)
    {
        ItemArgs e = new ItemArgs
        {
            hitCount = 0,
            itemtype = item
        };

        SendEvent(Consts.E_HitItem, e);//通知HitItemCtrl
    }
Ejemplo n.º 21
0
    public void OnInvincibleClick()
    {
        ItemArgs e = new ItemArgs
        {
            itemkind  = ItemKind.InvincibleItem,
            itemCount = 1
        };

        SendEvent(Const.E_HitItem, e);
    }
Ejemplo n.º 22
0
    public void OnMultiplyClick()
    {
        ItemArgs e = new ItemArgs
        {
            itemkind  = ItemKind.MultiplyItem,
            itemCount = 1
        };

        SendEvent(Const.E_HitItem, e);
    }
 private void OnItemDoubleClick(object sender, ItemArgs e)
 {
     if (e.PointerEventData.button == PointerEventData.InputButton.Left)
     {
         if (ItemDoubleClick != null)
         {
             ItemDoubleClick(this, new ProjectTreeEventArgs(e.Items.OfType <ProjectItem>().ToArray()));
         }
     }
 }
Ejemplo n.º 24
0
        protected virtual void OnItemDoubleClicked(object sender, ItemArgs e)
        {
            ExposeToEditor exposeToEditor = (ExposeToEditor)e.Items[0];

            if (exposeToEditor.CanEdit)
            {
                Editor.Selection.activeObject = exposeToEditor.gameObject;
                //ItemDoubleClick.Invoke();
            }
        }
Ejemplo n.º 25
0
        private void OnItemClick(object sender, ItemArgs e)
        {
            if (e.PointerEventData.button == PointerEventData.InputButton.Right)
            {
                IContextMenu        menu      = IOC.Resolve <IContextMenu>();
                List <MenuItemInfo> menuItems = new List <MenuItemInfo>();

                MenuItemInfo createFolder = new MenuItemInfo {
                    Path = "Create/Folder"
                };
                createFolder.Action = new MenuItemEvent();
                createFolder.Action.AddListener(CreateFolder);
                createFolder.Validate = new MenuItemValidationEvent();
                createFolder.Validate.AddListener(CreateValidate);
                menuItems.Add(createFolder);

                CreateMenuItem("Material", "Material", typeof(Material), menuItems);
                CreateMenuItem("Animation Clip", "AnimationClip", typeof(RuntimeAnimationClip), menuItems);

                MenuItemInfo open = new MenuItemInfo {
                    Path = "Open"
                };
                open.Action = new MenuItemEvent();
                open.Action.AddListener(Open);
                open.Validate = new MenuItemValidationEvent();
                open.Validate.AddListener(OpenValidate);
                menuItems.Add(open);

                MenuItemInfo duplicate = new MenuItemInfo {
                    Path = "Duplicate"
                };
                duplicate.Action = new MenuItemEvent();
                duplicate.Action.AddListener(Duplicate);
                duplicate.Validate = new MenuItemValidationEvent();
                duplicate.Validate.AddListener(DuplicateValidate);
                menuItems.Add(duplicate);


                MenuItemInfo deleteFolder = new MenuItemInfo {
                    Path = "Delete"
                };
                deleteFolder.Action = new MenuItemEvent();
                deleteFolder.Action.AddListener(Delete);
                menuItems.Add(deleteFolder);

                MenuItemInfo renameFolder = new MenuItemInfo {
                    Path = "Rename"
                };
                renameFolder.Action = new MenuItemEvent();
                renameFolder.Action.AddListener(Rename);
                menuItems.Add(renameFolder);

                menu.Open(menuItems.ToArray());
            }
        }
Ejemplo n.º 26
0
        private void OnItemDoubleClick(object sender, ItemArgs e)
        {
            VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(e.Items[0]);

            if (treeViewItem != null)
            {
                treeViewItem.IsExpanded = !treeViewItem.IsExpanded;
            }

            Input.ActivateInputField();
        }
Ejemplo n.º 27
0
    public void OnInvincibleClick()
    {
        Game.M_Instance.M_Sound.PlayEffect(Consts.S_Se_UI_Button);
        ItemArgs e = new ItemArgs
        {
            M_HitCount = 1,
            M_Kind     = ItemKind.ItemInvincible
        };

        MVC.SendEvent(Consts.E_HitItemController, e);
    }
        private void OnItemDoubleClicked(object sender, ItemArgs e)
        {
            GameObject     go             = (GameObject)e.Items[0];
            ExposeToEditor exposeToEditor = go.GetComponent <ExposeToEditor>();

            if (exposeToEditor.CanSelect)
            {
                RuntimeSelection.activeObject = go;
                ItemDoubleClick.Invoke();
            }
        }
Ejemplo n.º 29
0
    //按钮点击无敌口哨
    public void OnInvincibleBtnClick()
    {
        Game.Instance.Sound.PlayEffect("Se_UI_Button");
        ItemArgs e = new ItemArgs
        {
            hitCount = 1,
            itemtype = ItemType.ItemInvincible
        };

        SendEvent(Consts.E_HitItem, e);//通知HitItemCtrl
    }
        private void OnItemEndDrag(object sender, ItemArgs e)
        {
            Editor.DragDrop.RaiseDrop(e.PointerEventData);

            foreach (ProjectItem item in e.Items)
            {
                if (m_folders.All(f => f.Children == null || !f.Children.Contains(item)))
                {
                    m_listBox.RemoveChild(item.Parent, item, item.Parent.Children.Count == 1);
                }
            }
        }