54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class TitleCtrl : MonoBehaviour
|
|
{
|
|
[SerializeField] Image img;
|
|
bool is_a255 = false;
|
|
float dtime = 0;
|
|
private void Awake()
|
|
{
|
|
img.color = new Color(1, 1, 1, 0);
|
|
}
|
|
private void Start()
|
|
{
|
|
SoundManager.Instance.StartSound(SoundManager.eEftSuond.TitleSound);
|
|
}
|
|
void Update()
|
|
{
|
|
if (is_a255)
|
|
{
|
|
dtime += Time.deltaTime;
|
|
if (dtime >= 3.0f)
|
|
{
|
|
img.color -= new Color(0, 0, 0, 0.7f) * Time.deltaTime;
|
|
if (img.color.a <= -0.3f)
|
|
{
|
|
GameManager.Instance.NextScene(GameManager.eScene.Main);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
img.color += new Color(0, 0, 0, 1.0f) * Time.deltaTime;
|
|
if (img.color.a >= 1)
|
|
{
|
|
is_a255 = true;
|
|
}
|
|
}
|
|
if (Input.GetKeyDown(KeyCode.Escape))
|
|
{
|
|
if (SelectWindows.Instance.Active)
|
|
{
|
|
SelectWindows.Instance.OnPressCancel();
|
|
}
|
|
else
|
|
{
|
|
//SelectWindows.Instance.SetUI("게임을 종료하시겠습니까?", () => { GameManager.Instance.ExitWindows(); });
|
|
}
|
|
}
|
|
}
|
|
}
|