StartMenu!

This commit is contained in:
SoulliesOfficial
2025-03-08 14:21:10 -05:00
parent 28e0a6e4b0
commit e0ae43c25c
193 changed files with 43412 additions and 7940 deletions

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using Michsky.MUIP;
using UnityEngine;
using UnityEngine.Serialization;
namespace Ichni.StartMenu
{
public partial class StartPage : MonoBehaviour
{
public RectTransform background;
public CanvasGroup canvasGroup;
public ButtonManager createEmptyProjectButton;
public Sequence fadeIn, fadeOut;
private void Awake()
{
InitializeAnimations();
createEmptyProjectButton.onClick.AddListener(GoToNewProjectPage);
}
public void GoToNewProjectPage()
{
fadeOut.Restart();
}
}
public partial class StartPage
{
private void InitializeAnimations()
{
fadeIn = DOTween.Sequence();
fadeOut = DOTween.Sequence();
fadeIn.Join(canvasGroup.DOFade(1f, 0.5f))
.Join(background.DOScale(Vector3.one, 0.5f))
.SetEase(Ease.InOutQuad)
.SetAutoKill(false)
.OnComplete(() =>
{
canvasGroup.interactable = true;
canvasGroup.blocksRaycasts = true;
}).Pause();
fadeOut.Join(canvasGroup.DOFade(0f, 0.5f))
.Join(background.DOScale(Vector3.one * 2f, 0.5f))
.SetEase(Ease.InOutQuad)
.SetAutoKill(false)
.OnPlay(() =>
{
canvasGroup.interactable = false;
canvasGroup.blocksRaycasts = false;
})
.OnComplete(() =>
{
StartMenuManager.instance.createEmptyProjectPage.fadeIn.Restart();
})
.Pause();
}
}
}