first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
|
||||
[RequireComponent(typeof(CanvasGroup))]
|
||||
public class UIMenu : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private UIMenu _nextMenu;
|
||||
[SerializeField] private UIMenu _previousMenu;
|
||||
|
||||
private RectTransform _rectTransfrom;
|
||||
private CanvasGroup _canvasGroup;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_rectTransfrom = GetComponent<RectTransform>();
|
||||
_canvasGroup = GetComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
public void ShowNextMenu()
|
||||
{
|
||||
_nextMenu?.gameObject.SetActive(true);
|
||||
_canvasGroup.DOFade(0, .15f)
|
||||
.OnComplete(() => gameObject.SetActive(false));
|
||||
}
|
||||
|
||||
public void ShowPreviousMenu()
|
||||
{
|
||||
_previousMenu?.gameObject.SetActive(true);
|
||||
_canvasGroup.DOFade(0, .15f)
|
||||
.OnComplete(() => gameObject.SetActive(false));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a468f888ee4600243962d9bb0212fe8b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user