NoaApplicationResetCallbacks
Configure events related to the application reset feature.
By passing a class that inherits NoaApplicationResetCallbacks to NoaController, you can customize events related to the application reset feature.
Overridable Members
Methods
| Name | Description |
|---|---|
| OnBeforeApplicationReset() | Executed before the application reset process. |
| OnAfterApplicationReset() | Executed after the application reset process. Executed even if NOA Debugger’s application reset process was not executed. |
Properties
| Name | Description |
|---|---|
| IsAllowBaseApplicationReset | Determines whether to execute NOA Debugger’s application reset process. Default is true; if set to false, the application reset process is not executed. |
Related Types
INoaApplicationResetCallbacks
The overridable methods and properties of NoaApplicationResetCallbacks are defined in this interface.
If you want to consolidate multiple callback definitions in a custom class, or add callback functionality while inheriting an existing custom class, you can achieve this by using this interface instead of the NoaApplicationResetCallbacks class.
Sample Code
#if NOA_DEBUGGER
using NoaDebugger;
using UnityEngine;
// Example of executing events after NOA Debugger’s application reset process.
public class ExampleApplicationResetter : NoaApplicationResetCallbacks
{
public override void OnAfterApplicationReset()
{
// Output the scene name after the transition.
Debug.Log($"Transitioned to: {SceneManager.GetActiveScene().name}");
}
}
// Example of controlling whether to execute NOA Debugger’s application reset process with a custom flag.
public class ExampleOriginalApplicationResetter : NoaApplicationResetCallbacks
{
bool isAllowBaseApplicationReset = true;
public override bool IsAllowBaseApplicationReset => isAllowBaseApplicationReset;
public override void OnBeforeApplicationReset()
{
// Example of branching processing based on the current scene state.
switch (ExampleSceneManager.Instance.CurrentScene)
{
case SceneType.Boot:
case SceneType.Splash:
isAllowBaseApplicationReset = false;
break;
case SceneType.Title:
case SceneType.Home:
isAllowBaseApplicationReset = true;
break;
case SceneType.Battle:
ExampleBattleManager.Instance.InterruptBattle();
isAllowBaseApplicationReset = true;
break;
default:
isAllowBaseApplicationReset = false;
ExampleSceneManager.Instance.LoadScene(SceneType.Home);
break;
}
}
}
#endif
