using System; using System.Linq; using System.Reflection; using ET; namespace ET { public static class InitHotfix { public static async void Start() { try { string clientVersion = await GlobalHotfixProtoHelper.GetClintVersion(); if (!clientVersion.Equals(GlobalConfigComponent.Instance.GlobalProto.ClientVersion)) { Game.EventSystem.Publish(new ET.EventType.ShowMessageBox { title = "提示!", content = $"客户端有更新,请下载最新版客户端{clientVersion}!", action = async (MessageBoxEventId id) => { Game.EventSystem.Publish_Sync(new ET.EventType.Quit()); } }).Coroutine(); } if (Define.hasView) { Game.EventSystem.Add(Hotfix.instance.hotfix); Game.EventSystem.Add(Hotfix.instance.hotfixView); } else { Game.EventSystem.Add(Hotfix.instance.hotfix); } Game.Scene.AddComponent(); Game.Scene.AddComponent(); Game.Scene.AddComponent(); Game.Scene.AddComponent(); var config = Game.Scene.GetOrAddComponent(); Game.Scene.AddComponent(); Game.Scene.AddComponent(); Scene zoneScene = SceneFactory.CreateZoneScene(1, "Game"); OpcodeHotfixHelper.Init(); Game.EventSystem.Publish(new ET.EventType.AfterCreateZoneScene() { zoneScene = zoneScene }).Coroutine(); } catch (Exception e) { Log.Error(e); } } } }