Save/Load and Main Menu Submenus
Redid all of the property panel UI prefabs (oof) Implemented saving and loading of the game state Moved sector generation to sector constructor (along with loading from save file) Entity settings now separate from player settings Player settings (incl. saved run) now statically accessible from game manager Added animations and submenus to the main menu Unified main menu settings and properties panel styles for prefab reusability
This commit is contained in:
parent
549811f403
commit
b6828a975a
63 changed files with 2007 additions and 1158 deletions
35
Assets/Scripts/UI/TextButton.cs
Normal file
35
Assets/Scripts/UI/TextButton.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
public class TextButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
public Button Button;
|
||||
public TextMeshProUGUI Label;
|
||||
public float AnimationDuration;
|
||||
public float HoverSpacing;
|
||||
|
||||
private float _lerp;
|
||||
private bool _hovering;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
_lerp = saturate(_lerp + Time.deltaTime / AnimationDuration * (Button.interactable && _hovering ? 1 : -1));
|
||||
Label.characterSpacing = HoverSpacing * _lerp;
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
_hovering = true;
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
_hovering = false;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue