IEnumerator coroutineLoading(string levelName, dfProgressBar bar, ISwitchPanelBehaviour switchPanel) { async = Application.LoadLevelAsync(levelName); again: if (async.isDone) { Debug.Log("completed"); if (switchPanel != null) { switchPanel.Switch(); } } else { Debug.Log("LoadNewLevel: async.progress=" + async.progress); if (bar != null) { bar.Value = async.progress; } yield return(new WaitForEndOfFrame()); goto again; } }
public virtual void OnClick(dfControl control, dfMouseEventArgs args) { switchPanelBehaviour.Switch(); }