using System; using System.Reflection; using UnityEngine; using UnityEngine.Playables; public class GameStart : MonoBehaviour { public ShaderVariantCollection ShaderVariantCollection; public LoadType LoadType; public string h5Url; private GameStartUIPanel _gameStartUIPanel; private GameZip _gameZip; [ContextMenu("asdada")] public void Test() { } public void Start() { PottingMobile.InitializeSdk(); PottingMobile.withLogDebug(true); ShaderVariantCollection.WarmUp(); _gameStartUIPanel = GetComponent(); #if UNITY_ANDROID&& !UNITY_EDITOR _gameZip = new GameZip(); _gameZip.Start(_gameStartUIPanel, this, StartLoadGame); #else StartLoadGame(); #endif } private void StartLoadGame() { string typeName = "GameApplction"; // lock (ActivatorLoock) { Assembly assembly = Assembly.Load("Fort23.Mono"); System.Type type = assembly.GetType(typeName); IGameStart iGameStart = System.Activator.CreateInstance(type) as IGameStart; iGameStart.StartGame(LoadType, h5Url, _gameStartUIPanel, delegate { gameObject.SetActive(false); }); } } private void Update() { FileDownloadSystem.Instance.Update(); } }