comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -1,4 +1,5 @@
using System;
using JetBrains.Annotations;
using NaughtyAttributes;
using UnityEngine;
using Logger = EscapeRoomEngine.Engine.Runtime.Utilities.Logger;
@@ -30,10 +31,16 @@ namespace EscapeRoomEngine.Desert.Runtime
public delegate void ButtonEventHandler(Button source, ButtonEventType e);
/// <summary>
/// A general component for buttons that handles button events.
/// </summary>
public class Button : MonoBehaviour
{
public event ButtonEventHandler ButtonEvent;
/// <summary>
/// Whether this button accepts input.
/// </summary>
[ShowNativeProperty]
protected bool Active
{
@@ -50,6 +57,9 @@ namespace EscapeRoomEngine.Desert.Runtime
}
}
/// <summary>
/// Whether this button is currently pressed.
/// </summary>
[ShowNativeProperty]
protected bool Pressed
{
@@ -88,11 +98,15 @@ namespace EscapeRoomEngine.Desert.Runtime
#region Debug Buttons
[Button(enabledMode: EButtonEnableMode.Playmode)] public void Enable() => Active = true;
[Button(enabledMode: EButtonEnableMode.Playmode)] public void Disable() => Active = false;
[Button(enabledMode: EButtonEnableMode.Playmode)] public void Press() => Pressed = true;
[Button(enabledMode: EButtonEnableMode.Playmode)] public void Release() => Pressed = false;
[Button(enabledMode: EButtonEnableMode.Playmode)]
public void Enable() => Active = true;
[Button(enabledMode: EButtonEnableMode.Playmode)]
public void Disable() => Active = false;
[Button(enabledMode: EButtonEnableMode.Playmode)]
public void Press() => Pressed = true;
[Button(enabledMode: EButtonEnableMode.Playmode)]
public void Release() => Pressed = false;
[UsedImplicitly]
[Button(enabledMode: EButtonEnableMode.Playmode)]
public void PressAndRelease()
{