using ET; using ET.EventType; using FairyGUI; using UnityEngine; namespace ET { public class ClickOtherPlayerEvent: AEvent { private PopupMenu menu; public override async ETTask Run(ClickOtherPlayer args) { //显示菜单项 if(menu == null) { menu = new PopupMenu(FUI_PvpPopupMenu.URL); menu.AddItem("窥探", context => { GlobalVariable.IsMineCharacter = false; Game.EventSystem.Publish(new ET.EventType.OpenCharacterUI { zoneScene = MainUI.ui.ZoneScene() }).Coroutine(); }); menu.AddItem("私聊", context => { MainUI.PrivateChat(GlobalVariable.SelectUnitId); }); menu.AddItem("添加好友", context => { FriendUI.AddFriend(GlobalVariable.SelectUnitId).Coroutine(); }); menu.AddItem("邀请组队", context => { TeamHelper.InviteTeam().Coroutine(); }); menu.AddItem("申请入队", context => { TeamHelper.RequestTeam().Coroutine(); }); menu.AddItem("交易", context => { GButton item = (GButton)context.data; Debug.Log(item.name); }); menu.AddItem("PK",async context => { var ret =await SessionComponent.Instance.Call(new C2M_StartPKFight { TargetId = GlobalVariable.SelectUnitId }); if (!ret.Message.IsNullOrEmpty()) { Game.EventSystem.Publish(new ET.EventType.ShowTipUI { tip =ret.Message }).Coroutine(); } }); menu.AddItem("家族邀请", context => { GButton item = (GButton)context.data; Debug.Log(item.name); }); } menu.Show(); } } }