using System; using System.Collections; using System.Collections.Generic; using System.Net; using ET; using UnityEngine; namespace ET { public class CreateRoleHelper { public static async ETTask OnCreateRoleAsync(Scene zoneScene, int jobId,string name) { try { long userId = zoneScene.GetComponent().MyId; R2C_CreateRole r2C_Create = (R2C_CreateRole)await zoneScene.GetComponent().Session.Call(new C2R_CreateRole() { JobId = jobId, Name = name,PlayerId = userId }); if (!r2C_Create.Message.IsNullOrEmpty()) { Game.EventSystem.Publish(new ET.EventType.ShowTipUI { tip = r2C_Create.Message }).Coroutine(); return r2C_Create.Message; } Game.EventSystem.Publish(new ET.EventType.CreateRoleFinish_EnterGame { }).Coroutine(); return null; } catch (Exception e) { Log.Error(e); return e.ToString(); } } } }