39 lines
647 B
C#
39 lines
647 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using SHADE;
|
|||
|
|
|||
|
namespace SHADE_Scripting.UI
|
|||
|
{
|
|||
|
public class TransitToMainMenu: Script
|
|||
|
{
|
|||
|
public float timeToTransit = 0.0f;
|
|||
|
public uint sceneToChange = 0;
|
|||
|
private float timer = 0.0f;
|
|||
|
private bool sceneChanged = false;
|
|||
|
|
|||
|
protected override void start()
|
|||
|
{
|
|||
|
timer = timeToTransit;
|
|||
|
sceneChanged = false;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
protected override void update()
|
|||
|
{
|
|||
|
timer -= Time.DeltaTimeF;
|
|||
|
if(timer <= 0.0f && sceneChanged == false)
|
|||
|
{
|
|||
|
SceneManager.ChangeScene(sceneToChange);
|
|||
|
sceneChanged = true;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|