-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathABackButtonHandler.cs
More file actions
26 lines (23 loc) · 781 Bytes
/
ABackButtonHandler.cs
File metadata and controls
26 lines (23 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using UnityEngine;
namespace Gilzoide.BackButtonStack
{
/// <summary>
/// Abstract class for implementing ESC/Back button handlers with automatic registration in the singleton <see cref="BackButtonStack"/>.
/// </summary>
/// <remarks>
/// Object will be added to the stack in its <c>OnEnable</c> message and removed in <c>OnDisable</c>.
/// </remarks>
/// <seealso cref="IBackButtonHandler"/>
public abstract class ABackButtonHandler : MonoBehaviour, IBackButtonHandler
{
protected virtual void OnEnable()
{
this.AddToBackButtonStack();
}
protected virtual void OnDisable()
{
this.RemoveFromBackButtonStack();
}
public abstract void HandleBackButton();
}
}