2021-04-08 20:09:59 +08:00
|
|
|
|
using ET;
|
|
|
|
|
using FairyGUI;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class TeamHelper
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 邀请组队
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2021-04-20 00:25:04 +08:00
|
|
|
|
public static async ETVoid InviteTeam(Scene zoneScene)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_InviteTeam response = await zoneScene.GetComponent<SessionComponent>().Call<M2C_InviteTeam>(new C2M_InviteTeam() { TargetId = zoneScene.GetComponent<GlobalVariable>().SelectUnitId });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!response.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip =response.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 申请入队
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2021-04-20 00:25:04 +08:00
|
|
|
|
public static async ETVoid RequestTeam(Scene zoneScene)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_RequestTeam response = await zoneScene.GetComponent<SessionComponent>().Call<M2C_RequestTeam>(new C2M_RequestTeam() { TargetId = zoneScene.GetComponent<GlobalVariable>().SelectUnitId });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!response.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = response.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-20 00:25:04 +08:00
|
|
|
|
public static async ETVoid TransferTeamLeader(Scene zoneScene,long id)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_TransferTeamLeader response = await zoneScene.GetComponent<SessionComponent>().Call<M2C_TransferTeamLeader>(new C2M_TransferTeamLeader() {UnitId = id });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!response.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = response.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-20 00:25:04 +08:00
|
|
|
|
public static async ETVoid QuitTeam(Scene zoneScene)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_QuitTeam response = await zoneScene.GetComponent<SessionComponent>().Call<M2C_QuitTeam>(new C2M_QuitTeam() { });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!response.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = response.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-20 00:25:04 +08:00
|
|
|
|
public static async ETVoid KickoutTeam(Scene zoneScene,long id)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_KickoutTeam response = await zoneScene.GetComponent<SessionComponent>().Call<M2C_KickoutTeam>(new C2M_KickoutTeam() { TargetId = id });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!response.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = response.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|