// Start is called before the first frame update void Awake() { DontDestroyOnLoad(gameObject); UiManager.Instance().ShowUiForms(UiWind.LoadingWind.ToString()); Loading = GameObject.Find("LoadingWind(Clone)").GetComponent <LoadingWind>(); ResSvc.Instance().AsyncLoadScene("MainCity", () => { UiManager.Instance().ShowUiForms(UiWind.LoginWind.ToString()); }); }
private void Awake() { CurrentUiType.UiShowMode = UiShowMode.HideOther; RigisterButtonObjectEvent("Button", p => { if (StartGame.Instance().Loading == null) { StartGame.Instance().Loading = GameObject.Find("LoadingWind").GetComponent <LoadingWind>(); } ResSvc.Instance().AsyncLoadScene("Logoin", () => { OpenUIForm(UiWind.MainCityWind.ToString()); }); }); }
public void SetProgress(float prg) { tempProgress = Mathf.Lerp(tempProgress, prg, Time.deltaTime * 1);//设置进度条渐变到目标值 SetText(TxtPrg, (int)(tempProgress * 100) + "%"); SetText(TxtPrg, (int)(tempProgress / 9 * 10 * 100) + "%"); Load.fillAmount = tempProgress / 9 * 10; float pointX = loadWidth * tempProgress / 9 * 10 - 890; ImHead.GetComponent <RectTransform>().anchoredPosition = new Vector2(pointX, 0); if (tempProgress / 9 * 10 >= 0.995)//当进度到99.5%时,设置进度为100%,跳转下个场景 { SetText(TxtPrg, 100 + "%"); SetText(TxtPrg, 100 + "%"); Load.fillAmount = 1; ImHead.GetComponent <RectTransform>().anchoredPosition = new Vector2(885, 0); ResSvc.Instance().SceneAsync.allowSceneActivation = true; } }