InGameInspector
A class in Root.Township, the global namespace.
A debug tool item with 12 modes (LOD tools, chunk bounds, teleporters, console command runner, cloner, bubble inspector). Only players with the debug_features permission can hold it; others are forced to drop it.
- Listed in Global namespace: I to L
- Inherits or implements
NetworkEntityBehaviour - Nested types
BubbleInspectorTool,ChunkBounds,ClonerTool,CommandRunner,DirectTeleporter,InGameTool,LODBias,LODForcer,LODUpdater,LODVizualizer,MineStairsPointer,NonTeleporterInGameTool,SpawnPointTeleporter,StraightJumper - Attributes
RequireComponent
Constructors
| Member | What it is |
|---|---|
InGameInspector() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
18 private and internal fields
| Member | What it is |
|---|---|
private InGameInspector.InGameTool[] availableTools | The debug tools: LOD tools, chunk bounds, teleporters, mine stairs pointer, command runner, cloner and bubble inspector. |
private Image bg | Background image behind the label. |
private Material chunkBoundsMaterial | Material used by the chunk bounds tool. |
private PlayerInput controller | Player input of whoever is holding the inspector. |
private int currentTool | Backing field for CurrentTool, the index into availableTools. |
private AltaCoroutine displayingMessage | The running DisplayMessage coroutine, if any. |
private bool isDoubleClicking | Not used in this build. |
private bool isRaycasting | Whether the pointer ray is on. Tools only pick targets while it is. |
private bool isRotating | True while a swipe rotation is being tracked. |
private Color[] lodColors | Colours, one per LOD level, used by the LOD visualiser. |
private Material lodMaterial | Base material the LOD visualiser tints with lodColors. |
private LODChange log | Serialized LODChange reference. Not read by the inspector's own code. |
private float messageDuration | How long a timed message stays up, in seconds (2 by default). |
private Image minesCompass | Arrow image the mine stairs pointer turns toward the nearest stairs. |
private Text objectName | Text label that shows tool names and results. |
private Transform pointerTransform | Where the pointer ray starts and which way it points. |
private Vector2 previousValue | Swipe position when rotation tracking started. |
private MethodSyncStruct<int> syncMessage | Method sync made in Initialize and sent by SendMessage to share the current tool's data. |
Properties
4 private and internal properties
| Member | What it is |
|---|---|
private string DisplayText { get; set; } | Text on the inspector's label. Setting it shows the label, unless a timed message is showing. |
private Pickup Pickup { get; set; } | The pickup this inspector is on, found in Awake. |
private Vector3 Pointing { get; set; } | Direction the mines compass arrow points. Setting it turns the arrow toward that direction and shows it. |
private LineRenderer Renderer { get; set; } | Line renderer that draws the pointer ray while raycasting is on. |
Methods
10 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the pickup's interaction events, gets the line renderer and builds the 12 debug tools. |
private void CheckInput(PlayerInput playerInput) | On the local player's teleport press, starts tracking swipe rotation and passes the input to the current tool. |
private IEnumerator DisplayMessage(string message) (iterator) | Coroutine that shows a message (such as the tool name) for messageDuration seconds, then hides it. |
private void Interact(Interactable pickup, Interactor interactor) | On grab, drops the item if the local player lacks the debug_features permission, else enables the current tool. |
private void OnDestroy() | Disables the current tool. |
private void Start() | Empty. |
private void Stop(Interactable arg1, Interactor arg2) | On release, unhooks the teleport input, disables the current tool and hides the label and compass. |
private void SyncMessage(IPlayer player, Stream stream, int arguments) | Method sync that sends the tool index, then lets that tool serialize its own data. |
private void ToggleEnable(bool isEnabled) | When disabling, hides the label, background and mines compass. |
private void Update() | While held, turns swipe motion into an angle for the tool, draws the pointer ray and updates the current tool. |
Used in
Members of other types that take, return or hold a InGameInspector:
InGameInspector.BubbleInspectorTool.BubbleInspectorTool, InGameInspector.ChunkBounds.ChunkBounds, InGameInspector.ClonerTool.ClonerTool, InGameInspector.CommandRunner.CommandRunner, InGameInspector.DirectTeleporter.DirectTeleporter, InGameInspector.InGameTool.InGameTool, InGameInspector.InGameTool.Inspector, InGameInspector.LODBias.LODBias, InGameInspector.LODForcer.LODForcer, InGameInspector.LODUpdater.LODUpdater, InGameInspector.LODVizualizer.LODVizualizer, InGameInspector.MineStairsPointer.MineStairsPointer, InGameInspector.NonTeleporterInGameTool.NonTeleporterInGameTool, InGameInspector.SpawnPointTeleporter.SpawnPointTeleporter, InGameInspector.StraightJumper.StraightJumper, InGameInspectorWheel.inspector.