using System; using Cysharp.Threading.Tasks; using UnityEngine; using YooAsset; namespace Mono { public class Global : MonoBehaviour { [SerializeField] private EPlayMode _loadType = EPlayMode.EditorSimulateMode; [SerializeField] private float time; // [SerializeField] private GameInitType _gameInitType = GameInitType.None; [SerializeField] private Camera _playerCamera; [SerializeField] private Camera _playerUICamera; [SerializeField] private AudioListener _eye; private LoadDll loadDll; private void Awake() { DontDestroyOnLoad(this.gameObject); #if UNITY_EDITOR // this._loadType = EPlayMode.EditorSimulateMode; #elif UNITY_ANDROID|| PLATFORM_ANDROID|| ENABLE_WEBCAM|| UNITY_WEBGL|| UNITY_EDITOR_WIN this._loadType = EPlayMode.HostPlayMode; #endif this.loadDll = new LoadDll(); this.Initialized().Forget(); } private async UniTask Initialized() { await ResourceComponent.Instance.InitLoadModeAsync(this._loadType, "DefaultPackage"); // loadDll await this.loadDll.DownloadAsync(); this.loadDll.OnStart(); // // object[] pa = new object[] // { // gameObject, this._loadType, this._gameInitType // }; // var instance = Activator.CreateInstance(onStart, pa); // this.game = instance as Game.Game; // if (this.game == null) // { // Debug.Log("????????????????????????"); // } // else // { // this.game.Awake(); // // this.game.Start(); // } } private void OnEnable() { } private void Update() { } private void FixedUpdate() { } private void OnDisable() { } private void OnDestroy() { } } }