private void InitializeFusion() { string path = "_GameAssets/Res/Prefabs/Audio/AudioListener"; EB.Assets.LoadAsync(path, typeof(GameObject), o => { if (o) { GameObject.Instantiate(o); GM.AssetUtils.FixShaderInEditor(o); } }); Shader.WarmupAllShaders(); DG.Tweening.DOTween.Init(); //QuestManager.Instance(); ProfileManager.Initialize(); PSPoolManager.InitializeInstance(); GameEngine.Instance.gameObject.AddComponent <TouchController>(); GameEngine.Instance.gameObject.AddComponent <FusionSparxHelper>(); EB.Sparx.SparxAPI.GlobalErrorHandler += eResponseCodeUIExtensions.GlobalErrorHandler; EB.Sparx.Response.SetErrorTranslatorHandler(eResponseCodeUIExtensions.ErrorTranslateHandler); EB.Sparx.PushManager pm = SparxHub.Instance.GetManager <EB.Sparx.PushManager>(); EB.Sparx.SparxAPI.GlobalResultHandler += pm.GlobalApiResultSyncHandler; SparxHub.Instance.ApiEndPoint.PostHandler += pm.EndPointPostAsyncHandler; SparxHub.Instance.ApiEndPoint.SuspendHandler += eResponseCodeUIExtensions.SuspendHandler; }
public static void InitializeInstance() { if (_instance == null) { GameObject psPool = new GameObject("PSPoolManager"); if (Application.isPlaying) { DontDestroyOnLoad(psPool.gameObject); } psPool.CustomSetActive(false); _instance = psPool.AddComponent <PSPoolManager>(); _instance.Awake(); _created = true; } }