1
Fork 0
mirror of https://github.com/Steffo99/bleach-beach.git synced 2024-12-04 19:04:19 +00:00
bleach-beach/Assets/Scripts/GameStarter.cs
2018-08-12 17:55:36 +02:00

30 lines
630 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class GameStarter : MonoBehaviour {
public Image image;
public GameObject fade;
private Animator animator;
private void Start()
{
animator = fade.GetComponent<Animator>();
}
private void Update()
{
if (animator.GetBool("Finished"))
{
SceneManager.LoadSceneAsync("Game", LoadSceneMode.Single);
}
}
void OnTriggerEnter2D(Collider2D GameStart)
{
animator.SetBool("Fade", true);
}
}