| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 | 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.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<GMPanelView>();            }            else            {                ViewManager.Show<LogView>();            }        }    }}
 |