private void Awake() { PersistentUObjectHelper.AddGameObject(gameObject); GameLauncher.Startup(); LoaderUtill.Init((result) => { string assetPath = "TestPrefab"; UnityObject[] uObjects = LoaderUtill.InstanceAssetsSync(new string[] { assetPath }); if (uObjects == null || uObjects.Length == 0) { Debug.LogError("FFFFFFFFFFFFFFFFFFFFFF"); } else { UnityObject uObject = uObjects[0]; (uObject as GameObject).name = "Test Prefab"; (uObject as GameObject).transform.position = new Vector3(0, 0, 0); } LoaderUtill.LoadAssetsAsync(new string[] { "login_panel" }, null, (index, address, uObject, userdata) => { if (uObject != null) { UnityObject instance = LoaderUtill.InstanceUObject(address, uObject); (instance as GameObject).name = "Test Login Panel"; } else { Debug.LogError("DDDDDDDDDDDDD"); } }, null, null, AsyncPriority.Default, null); }); }
public void Init() { rectTransform = GameObject.Instantiate(ResManager.Instance.Load <GameObject>("prefabs", "ABRes/Prefabs/UI/Loading/Window_Login.prefab")).transform as RectTransform; GameLauncher.AddToUI(rectTransform); Hide(); btn_Login = rectTransform.Find("btn_Login").GetComponent <Button>(); //GameLauncher.Instance.StartCoroutine(ABManager.Instance.DownloadVersionFile(ABManager.Instance.VERSIONPATH, DownloadVersionFileComplete)); }
public void Init() { rectTransform = GameObject.Instantiate(ResManager.Instance.Load <GameObject>("loading", "ABRes/Loading/Window_Loading.prefab")).transform as RectTransform; GameLauncher.AddToUI(rectTransform); txt_Loading = rectTransform.Find("txt_Loading").GetComponent <Text>(); txt_Loading.text = "下载AB: 0"; slider_Progress = rectTransform.Find("slider_Progress").GetComponent <Slider>(); //ABManager.Instance.DownloadABs(DownloadAB, LoadAB, DownloadAndLoadComplete); //GameLauncher.Instance.StartCoroutine(ABManager.Instance.DownloadVersionFileCorountine(ABManager.Instance.VERSIONPATH, DownloadVersionFileComplete)); }
private void OnDisable() { GameLauncher.Shutdown(); }