comment pass
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user