public void BonfireSelected(BonfireLocation bonfire) { Debug.Log("Warping to " + bonfire.LocationName); BonfireGameState.BonfireLocation = bonfire.LocationName; this.GetComponent <AudioSource>().outputAudioMixerGroup = AudioState.EffectGroup; this.GetComponent <AudioSource>().PlayOneShot(OnInteract); StartCoroutine(LoadScene(bonfire)); }
public BonfireLocation Clone() { BonfireLocation bl = new BonfireLocation(); bl.LocationName = LocationName; bl.Scene = Scene; bl.NameInScene = NameInScene; bl.IsLit = IsLit; return(bl); }
IEnumerator LoadScene(BonfireLocation bonfire) { yield return(new WaitForSeconds(OnInteract.length - 1.0f)); AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(bonfire.Scene); asyncOperation.allowSceneActivation = false; while (!asyncOperation.isDone) { if (asyncOperation.progress >= 0.9f) { asyncOperation.allowSceneActivation = true; } yield return(null); } }