Files
ichni_Official/Assets/Scripts/UI/StartPage/StartUIPage.cs

50 lines
1.5 KiB
C#
Raw Normal View History

2025-06-03 02:42:28 -04:00
using System;
using System.Collections;
using System.Collections.Generic;
2025-08-23 05:29:37 -04:00
using DG.Tweening;
2025-06-03 02:42:28 -04:00
using UnityEngine;
2025-08-27 21:45:18 -04:00
using UnityEngine.Serialization;
2025-06-03 02:42:28 -04:00
2025-06-06 10:14:55 -04:00
namespace Ichni.UI
2025-06-03 02:42:28 -04:00
{
2025-06-06 10:14:55 -04:00
public class StartUIPage : UIPageBase
2025-06-03 02:42:28 -04:00
{
public AudioContainer audioContainer;
2025-08-22 14:54:40 -04:00
2025-12-12 11:09:39 -05:00
//public List<ParticleSystem> logoParticles;
2025-08-23 05:29:37 -04:00
public ParticleSystem floatingParticles;
2025-08-27 21:45:18 -04:00
public GameObject peWarningWindow;
public GameObject contentWindow;
2025-08-22 14:54:40 -04:00
protected override void Awake()
2025-06-03 02:42:28 -04:00
{
2025-08-22 14:54:40 -04:00
base.Awake();
2025-06-03 02:42:28 -04:00
audioContainer = GetComponent<AudioContainer>();
}
2025-08-27 21:45:18 -04:00
private void Start()
{
Sequence peWarningSequence = DOTween.Sequence();
peWarningSequence.Append(peWarningWindow.GetComponent<CanvasGroup>().DOFade(1f, 0.5f));
peWarningSequence.AppendInterval(1f);
peWarningSequence.Append(peWarningWindow.GetComponent<CanvasGroup>().DOFade(0f, 0.5f).OnStart(() => contentWindow.SetActive(true)));
peWarningSequence.AppendCallback(() =>
{
peWarningWindow.SetActive(false);
floatingParticles.Play();
});
peWarningSequence.Play();
}
2025-06-03 02:42:28 -04:00
public void TouchToStart()
{
audioContainer.PlaySoundFX("TouchToStart");
2025-08-23 05:29:37 -04:00
2025-06-06 10:14:55 -04:00
FadeOut();
2025-08-23 05:29:37 -04:00
floatingParticles.GetComponent<Renderer>().material.DOColor(Color.clear, "_BaseColor", 0.5f).Play();
2025-06-06 10:14:55 -04:00
ChapterSelectionManager.instance.chapterSelectionUIPage.FadeIn();
2025-06-03 02:42:28 -04:00
}
}
}