示例#1
0
 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));
 }
示例#2
0
    public BonfireLocation Clone()
    {
        BonfireLocation bl = new BonfireLocation();

        bl.LocationName = LocationName;
        bl.Scene        = Scene;
        bl.NameInScene  = NameInScene;
        bl.IsLit        = IsLit;
        return(bl);
    }
示例#3
0
    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);
        }
    }