2021-04-08 20:09:59 +08:00
|
|
|
|
using ET;
|
|
|
|
|
using ET.EventType;
|
|
|
|
|
using FairyGUI;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class ClickOtherPlayerEvent: AEvent<ET.EventType.ClickOtherPlayer>
|
|
|
|
|
{
|
|
|
|
|
private PopupMenu menu;
|
|
|
|
|
public override async ETTask Run(ClickOtherPlayer args)
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
var zoneScene = args.zoneScene;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
//显示菜单项
|
|
|
|
|
if(menu == null)
|
|
|
|
|
{
|
|
|
|
|
menu = new PopupMenu(FUI_PvpPopupMenu.URL);
|
|
|
|
|
menu.AddItem("窥探", context =>
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
zoneScene.GetComponent<GlobalVariable>().IsMineCharacter = false;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.OpenCharacterUI
|
|
|
|
|
{
|
|
|
|
|
zoneScene = MainUI.ui.ZoneScene()
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
});
|
|
|
|
|
menu.AddItem("私聊", context =>
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
MainUI.PrivateChat(zoneScene.GetComponent<GlobalVariable>().SelectUnitId);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
});
|
|
|
|
|
menu.AddItem("添加好友", context =>
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
FriendUI.AddFriend(zoneScene,zoneScene.GetComponent<GlobalVariable>().SelectUnitId).Coroutine();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
});
|
|
|
|
|
menu.AddItem("邀请组队", context =>
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
TeamHelper.InviteTeam(zoneScene).Coroutine();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
});
|
|
|
|
|
menu.AddItem("申请入队", context =>
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
TeamHelper.RequestTeam(zoneScene).Coroutine();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
});
|
|
|
|
|
menu.AddItem("交易", context =>
|
|
|
|
|
{
|
|
|
|
|
GButton item = (GButton)context.data;
|
|
|
|
|
Debug.Log(item.name);
|
|
|
|
|
});
|
|
|
|
|
menu.AddItem("PK",async context =>
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_StartPKFight ret =await zoneScene.GetComponent<SessionComponent>().Call<M2C_StartPKFight>(new C2M_StartPKFight { TargetId = zoneScene.GetComponent<GlobalVariable>().SelectUnitId });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|