using System; using ET; using FairyGUI; namespace GFGGame { public class GMController { public static async ETTask GetAllDressUpItem() { GetSuitItemController.enable = false; //获得所有换装部件 var errorCode = await GMSProxy.SendGMToServer("get all dressup"); GetSuitItemController.enable = true; if (errorCode != ET.ErrorCode.ERR_Success) { ErrorCodeController.Handler(errorCode); return; } PromptController.Instance.ShowFloatTextPrompt("已获得所有服装", MessageType.SUCCESS); } public static async ETTask GetAllCardItem() { //获得所有卡牌部件 var errorCode = await GMSProxy.SendGMToServer("get all card"); if (errorCode != ET.ErrorCode.ERR_Success) { ErrorCodeController.Handler(errorCode); return; } PromptController.Instance.ShowFloatTextPrompt("已获得所有卡牌", MessageType.SUCCESS); } public static async ETTask SendGMCommand(string messageGM, string messageSuc) { var errorCode = await GMSProxy.SendGMToServer(messageGM); if (errorCode != ET.ErrorCode.ERR_Success) { ErrorCodeController.Handler(errorCode); return false; } InstanceZonesSProxy.GetInstanceZonesInfos().Coroutine(); MainStorySProxy.GetStoryInfos().Coroutine(); PromptController.Instance.ShowFloatTextPrompt(messageSuc, MessageType.SUCCESS); return true; } private static int index = 0; public static void AddShowGMViewEventListener() { GRoot.inst.onTouchBegin.Add(OnTouchBegin); } private static void OnTouchBegin(EventContext context) { if (context.inputEvent.button == 1 || Stage.inst.touchCount == 2) { if (index == 0) { Timers.inst.Add(1, 1, OnTimeComplete); } index++; if (index == 2) { ShowGmView(); } } } private static void OnTimeComplete(object param) { index = 0; } public static void ShowGmView() { if (ViewManager.isViewOpen(typeof(PhotographView).FullName)) return; if (GameConfig.showGM >= 1) { ViewManager.Show(ViewName.GM_PANEL_VIEW); } else { ViewManager.Show(ViewName.LOG_VIEW); } } } }