77 lines
2.3 KiB
C#
77 lines
2.3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using Michsky.MUIP;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Ichni.StartMenu
|
|
{
|
|
public partial class StartPage : StartMenuPage
|
|
{
|
|
public RectTransform background;
|
|
public TMP_Text logText;
|
|
|
|
public ButtonManager createEmptyProjectButton;
|
|
public Button editorSettingsButton;
|
|
public Button quitButton;
|
|
}
|
|
|
|
public partial class StartPage
|
|
{
|
|
protected override 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;
|
|
})
|
|
.Pause();
|
|
}
|
|
|
|
protected override void InitializeUI()
|
|
{
|
|
createEmptyProjectButton.onClick.AddListener(GoToNewProjectPage);
|
|
editorSettingsButton.onClick.AddListener(GoToEditorSettingsPage);
|
|
quitButton.onClick.AddListener(Application.Quit);
|
|
}
|
|
|
|
private void GoToNewProjectPage()
|
|
{
|
|
fadeOut.onComplete = () =>
|
|
{
|
|
StartMenuManager.instance.createEmptyProjectPage.fadeIn.Restart();
|
|
};
|
|
fadeOut.Restart();
|
|
}
|
|
|
|
private void GoToEditorSettingsPage()
|
|
{
|
|
fadeOut.onComplete = () =>
|
|
{
|
|
StartMenuManager.instance.editorSettingsPage.fadeIn.Restart();
|
|
};
|
|
fadeOut.Restart();
|
|
}
|
|
}
|
|
} |