public void OnProgressUpdate(object sender, GameEventArgs e) { LoadingFormUpdateProgressEventArgs ne = e as LoadingFormUpdateProgressEventArgs; SetText(txtPrg, (int)(ne.Progress * 100) + "%"); imgFG.fillAmount = ne.Progress; float posX = ne.Progress * fgWidth - 545; imgPoint.GetComponent <RectTransform>().anchoredPosition = new Vector2(posX, 0); }
private void OnLoadSceneUpdate(object sender, GameEventArgs e) { LoadSceneUpdateEventArgs ne = (LoadSceneUpdateEventArgs)e; if (ne.UserData != this) { return; } //Log.Info("Load scene '{0}' update, progress '{1}'.", ne.SceneAssetName, ne.Progress.ToString("P2")); string description = string.Format("正在加载场景:[{0}],加载进度:[{1}]。", ne.SceneAssetName, ne.Progress.ToString("P2")); LoadingFormUpdateProgressEventArgs eventArgs = ReferencePool.Acquire <LoadingFormUpdateProgressEventArgs>(); eventArgs.Fill(description, ne.Progress, null); GameEntry.Event.Fire(this, eventArgs); }