rise-and-swine/Assets/Scripts/Assembly-CSharp/StarLevelTransition.cs

36 lines
727 B
C#
Raw Permalink Normal View History

2023-02-25 23:04:03 -05:00
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;
}