22 lines
598 B
C#
22 lines
598 B
C#
using NaughtyAttributes;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace EscapeRoomEngine.Engine.Runtime.UI
|
|
{
|
|
/// <summary>
|
|
/// This component is responsible to change the icon of the pause button depending on the game state.
|
|
/// </summary>
|
|
public class PauseButton : MonoBehaviour
|
|
{
|
|
[BoxGroup("Internal")] [SerializeField]
|
|
private Image icon;
|
|
[BoxGroup("Internal")] [SerializeField]
|
|
private Sprite pauseIcon, resumeIcon;
|
|
|
|
public bool Paused
|
|
{
|
|
set => icon.sprite = value ? resumeIcon : pauseIcon;
|
|
}
|
|
}
|
|
} |