This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
project-undercover/Project Undercover/Assets/Scripts/UI/SplashController.cs

35 lines
752 B
C#
Raw Permalink Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SplashController : MonoBehaviour {
private Image splashText;
private float timer;
void Start () {
splashText = GetComponent<Image> ();
Color tempcolor = Color.white;
tempcolor.a = 0;
splashText.color = tempcolor;
timer = 4;
}
void Update () {
Color setalpha = Color.white;
timer -= Time.deltaTime;
if(timer >= 2.5 && timer < 3.5) {
setalpha.a = 1 - (timer - 2.5f);
splashText.color = setalpha;
}
if(timer >= 0.5 && timer < 1.5) {
setalpha.a = (timer - 0.5f);
splashText.color = setalpha;
}
if(timer <= 0) {
SceneManager.LoadScene ("MainMenu");
}
}
}