public Item(ItemArgs args) { this.Name = args.Name; this.cost = args.cost; this.graphic = args.graphic; this.weight = args.weight; }
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); } }
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(); }
protected virtual void OnItemEndDrag(object sender, ItemArgs e) { if (Editor.DragDrop.InProgress) { Editor.DragDrop.RaiseDrop(e.PointerEventData); } }
private void OnItemDoubleClick(object sender, ItemArgs e) { if (DoubleClick != null) { DoubleClick(this, new ProjectResourcesEventArgs(e.Items.OfType <ProjectItemObjectPair>().ToArray())); } }
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())); } }
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(); }
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(); }
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 }); } }
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; //} }
private void OnItemDoubleClick(object sender, ItemArgs e) { if (e.PointerEventData.button == PointerEventData.InputButton.Left) { ProjectItem projectItem = (ProjectItem)e.Items[0]; Toggle(projectItem); } }
public void OnMultipleClick() { ItemArgs e = new ItemArgs() { count = 1, kind = ItemKind.multipleItem }; SendEvent(Consts.E_HitItem, e); }
public void OnInvincibleClick() { ItemArgs e = new ItemArgs() { count = 1, kind = ItemKind.invincibleItem }; SendEvent(Consts.E_HitItem, e); }
/// <summary> /// Magnet /// </summary> public void OnMagnetClick() { ItemArgs e = new ItemArgs() { count = 1, kind = ItemKind.magnetItem }; SendEvent(Consts.E_HitItem, e); }
private void OnItemClick(object sender, ItemArgs e) { ToolCmd cmd = (ToolCmd)e.Items[0]; if (cmd.Validate()) { cmd.Run(); } }
public void HitItem(ItemKind item) { ItemArgs e = new ItemArgs { M_Kind = item, M_HitCount = 0 }; MVC.SendEvent(Consts.E_HitItemController, e); }
private void OnItemDoubleClicked(object sender, ItemArgs e) { ExposeToEditor exposeToEditor = (ExposeToEditor)e.Items[0]; if (exposeToEditor.CanSelect) { Editor.Selection.activeObject = exposeToEditor.gameObject; ItemDoubleClick.Invoke(); } }
//处理碰到奖励物品 public void HitItem(ItemType item) { ItemArgs e = new ItemArgs { hitCount = 0, itemtype = item }; SendEvent(Consts.E_HitItem, e);//通知HitItemCtrl }
public void OnInvincibleClick() { ItemArgs e = new ItemArgs { itemkind = ItemKind.InvincibleItem, itemCount = 1 }; SendEvent(Const.E_HitItem, e); }
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())); } } }
protected virtual void OnItemDoubleClicked(object sender, ItemArgs e) { ExposeToEditor exposeToEditor = (ExposeToEditor)e.Items[0]; if (exposeToEditor.CanEdit) { Editor.Selection.activeObject = exposeToEditor.gameObject; //ItemDoubleClick.Invoke(); } }
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()); } }
private void OnItemDoubleClick(object sender, ItemArgs e) { VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(e.Items[0]); if (treeViewItem != null) { treeViewItem.IsExpanded = !treeViewItem.IsExpanded; } Input.ActivateInputField(); }
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(); } }
//按钮点击无敌口哨 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); } } }