| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 | 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<bool> 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.GetStoryBonusInfos().Coroutine();            PromptController.Instance.ShowFloatTextPrompt(messageSuc, MessageType.SUCCESS);            return true;        }        private static int index = 0;        public static void AddShowGMViewEventListener()        {            if (GameConfig.showGM >= 1)                GRoot.inst.onTouchBegin.Add(OnTouchBegin);        }        private static void OnTouchBegin(EventContext context)        {            //LogUtil.LogDev($"OnTouchBegin 1 {context.inputEvent.button} {Stage.inst.touchCount}");            if (context.inputEvent.button == 1 || Stage.inst.touchCount == 2)            {                //LogUtil.LogDev("OnTouchBegin 2");                if (index == 0)                {                    Timers.inst.Add(0.5f, 1, OnTimeComplete);                }                index++;                if (index == 3)                {                    ShowGmView();                }            }        }        private static void OnTimeComplete(object param)        {            index = 0;            //LogUtil.LogDev("OnTimeComplete");        }        public static void ShowGmView()        {            //LogUtil.LogDev("ShowGmView");            if (ViewManager.isViewOpen(typeof(PhotographView).FullName)) return;            if (ViewManager.isViewOpen(typeof(StoryDialogView).FullName)) return;            if (GameConfig.showGM >= 1)            {                ViewManager.Show<GMPanelView>();            }        }    }}
 |