Files
ichni_Official/Assets/Scripts/UI/StartPage/StartUIPage.cs
SoulliesOfficial 07f3511133
2025-12-12 11:09:39 -05:00

50 lines
1.5 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.Serialization;
namespace Ichni.UI
{
public class StartUIPage : UIPageBase
{
public AudioContainer audioContainer;
//public List<ParticleSystem> logoParticles;
public ParticleSystem floatingParticles;
public GameObject peWarningWindow;
public GameObject contentWindow;
protected override void Awake()
{
base.Awake();
audioContainer = GetComponent<AudioContainer>();
}
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();
}
public void TouchToStart()
{
audioContainer.PlaySoundFX("TouchToStart");
FadeOut();
floatingParticles.GetComponent<Renderer>().material.DOColor(Color.clear, "_BaseColor", 0.5f).Play();
ChapterSelectionManager.instance.chapterSelectionUIPage.FadeIn();
}
}
}