rise-and-swine/Assets/Scripts/Assembly-CSharp/StarLevelTransition.cs
2023-02-25 23:04:03 -05:00

35 lines
727 B
C#

using UnityEngine;
public class StarLevelTransition : MonoBehaviour
{
private void LoadLevel()
{
if (!this.m_loading)
{
this.m_loading = true;
Singleton<GameManager>.Instance.LoadStarLevelAfterTransition();
}
}
private void Start()
{
GameObject ambientCave = Singleton<GameManager>.Instance.gameData.commonAudioCollection.AmbientCave;
Singleton<AudioManager>.Instance.Play2dEffect(ambientCave.GetComponent<AudioSource>());
}
private void Update()
{
this.m_skipTimer += Time.deltaTime;
if (GuiManager.GetPointer().up && !this.m_skip && this.m_skipTimer > 1f)
{
this.m_skip = true;
this.LoadLevel();
}
}
private bool m_skip;
private bool m_loading;
private float m_skipTimer;
}