как сделать переход на другую сцену с задержкой?
вот код
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
public class buttons : MonoBehaviour
{
public float timer = 5.0f;
public GameObject clickup;
private void OnMouseDown()
{
GetComponent<AudioSource>().Play();
transform.localScale = new Vector3(1.4f, 1.4f, 1.4f);
}
private void OnMouseUp()
{
timer -= Time.deltaTime;
if (timer <= 0)
{
SceneManager.LoadScene("game", LoadSceneMode.Single);
}
transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
}
}