Through this class, you can control the initialization and launch of NOA Debugger from the script.
API | Description |
---|
Initialize() | Initializes the tool. |
Show(index) | Launches the tool and open a specific menu. |
Hide() | Closes the tool and display the targeted floating window. |
SetDebuggerActive(isActive) | Toggles the display/hide of the tool. |
SetFloatingWindowActive(isActive) | Toggles the display/hide of the tool's floating window. |
SetTriggerButtonActive(isActive) | Toggles the display/hide of the tool's launch button. |
EnableWorldSpaceRendering(worldCamera) | Displays the tool on the world coordinates. If the arguments are omitted, the MainCamera is applied to the Canvas drawing. While displayed on the world coordinates, the floating window and the launch button are not displayed. |
DisableWorldSpaceRendering() | Displays the tool on 2D screen coordinates. |
Destroy() | Destroys the tool. |
API | Description |
---|
OnShow | Callback that is fired when the tool is launched. You can get the index value of the menu when the callback is fired. |
OnHide | Callback that is fired when the tool is closed. You can get the index value of the menu when the callback is fired. |
OnMenuChanged | This is a callback that is fired when the tool menu is switched. You can get the index value of the menu after the switch and a flag indicating whether it is a custom menu when the callback is fired. |
RootTransform | Returns a reference to the most top-level Transform of the tool. |
IsInitialized | Returns true if the tool is initialized. |
IsWorldSpaceRenderingEnabled | Returns true if the tool is being displayed on the world coordinates. |
IsDebuggerVisible | Returns true if the tool is displayed. |
IsTriggerButtonVisible | Returns true if the tool's launch button is displayed. |
IsFloatingWindowVisible | Returns true if the dedicated window is displayed. |
using UnityEngine;
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class Example
{
void ExampleMethod()
{
#if NOA_DEBUGGER
NoaDebug.Initialize();
bool isDebuggerInit = NoaDebug.IsInitialized;
NoaDebug.OnShow = (index) => Debug.Log($"showIndex:{index}");
NoaDebug.Show();
NoaDebug.OnHide = (index) => Debug.Log($"hideIndex:{index}");
NoaDebug.Hide();
NoaDebug.Show(3);
NoaDebug.OnMenuChanged = (index, isCustomMenu) => Debug.Log($"menuIndex:{index} isCustomMenu:{isCustomMenu}");
NoaDebug.SetDebuggerActive(false);
NoaDebug.SetDebuggerActive(true);
NoaDebug.SetFloatingWindowActive(false);
NoaDebug.SetFloatingWindowActive(true);
NoaDebug.SetTriggerButtonActive(false);
NoaDebug.SetTriggerButtonActive(true);
NoaDebug.EnableWorldSpaceRendering(Camera.main);
Transform noaDebuggerRoot = NoaDebug.RootTransform;
noaDebuggerRoot.localPosition = Vector3.zero;
noaDebuggerRoot.localEulerAngles = Vector3.zero;
noaDebuggerRoot.localScale = new Vector3(0.00264f, 0.00264f, 0.00264f);
noaDebuggerRoot.gameObject.layer = 0;
bool isWorldSpace = NoaDebug.IsWorldSpaceRenderingEnabled;
NoaDebug.DisableWorldSpaceRendering();
bool IsDebuggerVisible = NoaDebug.IsDebuggerVisible;
bool IsTriggerButtonVisible = NoaDebug.IsTriggerButtonVisible;
bool IsFloatingWindowVisible = NoaDebug.IsFloatingWindowVisible;
NoaDebug.Destroy();
#endif
}
}