/// <summary> /// 同步加载场景 /// </summary> /// <param name="sceneName">场景在BuildSettings窗口的路径或名称</param> /// <param name="mode">加载模式</param> public void Load(string sceneName, LoadSceneMode mode) { SceneManager.LoadScene(sceneName, mode); //为了能够侦听场景加载完成时设置为激活场景,所以激活 gameObject.SetActive(true); m_progressbar.gameObject.SetActive(true); m_progressbar.SetProgress(1.0f); }
private void OnLoadStart(bool progressbarVisible) { m_isLoading = true; m_progressValue = 0.0f; if (m_progressbar != null) { m_progressbar.SetProgress(m_progressValue); m_progressbar.SetText("loading 0%..."); m_progressbar.gameObject.SetActive(progressbarVisible); } gameObject.SetActive(true); }
public override void OnUpdate() { if (widget != null) { widget.SetProgress(progress.Value); } }
public override void OnEnter() { base.OnEnter(); widget = UIUtility.Find <Progressbar> (_name.Value); if (widget != null) { widget.SetProgress(progress.Value); } if (!everyFrame) { Finish(); } }