77 lines
2.6 KiB
C#
77 lines
2.6 KiB
C#
using ET;
|
|
using FairyGUI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class TeamHelper
|
|
{
|
|
/// <summary>
|
|
/// 邀请组队
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static async ETVoid InviteTeam()
|
|
{
|
|
M2C_InviteTeam response = await SessionComponent.Instance.Call<M2C_InviteTeam>(new C2M_InviteTeam() { TargetId = GlobalVariable.SelectUnitId });
|
|
if (!response.Message.IsNullOrEmpty())
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
{
|
|
tip =response.Message
|
|
}).Coroutine();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 申请入队
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static async ETVoid RequestTeam()
|
|
{
|
|
M2C_RequestTeam response = await SessionComponent.Instance.Call<M2C_RequestTeam>(new C2M_RequestTeam() { TargetId = GlobalVariable.SelectUnitId });
|
|
if (!response.Message.IsNullOrEmpty())
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
{
|
|
tip = response.Message
|
|
}).Coroutine();
|
|
}
|
|
}
|
|
|
|
public static async ETVoid TransferTeamLeader(long id)
|
|
{
|
|
M2C_TransferTeamLeader response = await SessionComponent.Instance.Call<M2C_TransferTeamLeader>(new C2M_TransferTeamLeader() {UnitId = id });
|
|
if (!response.Message.IsNullOrEmpty())
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
{
|
|
tip = response.Message
|
|
}).Coroutine();
|
|
}
|
|
}
|
|
public static async ETVoid QuitTeam()
|
|
{
|
|
M2C_QuitTeam response = await SessionComponent.Instance.Call<M2C_QuitTeam>(new C2M_QuitTeam() { });
|
|
if (!response.Message.IsNullOrEmpty())
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
{
|
|
tip = response.Message
|
|
}).Coroutine();
|
|
}
|
|
}
|
|
public static async ETVoid KickoutTeam(long id)
|
|
{
|
|
M2C_KickoutTeam response = await SessionComponent.Instance.Call<M2C_KickoutTeam>(new C2M_KickoutTeam() { TargetId = id });
|
|
if (!response.Message.IsNullOrEmpty())
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
{
|
|
tip = response.Message
|
|
}).Coroutine();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|