Skip to main content

InGameInspector.ClonerTool

A private class in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Debug inspector tool that saves the object you point at and spawns copies of it in front of the pointer. Cloning only works on the server.

Constructors​

MemberWhat it is
ClonerTool(InGameInspector inspector)Creates an InGameInspector.ClonerTool from inspector.

Fields​

2 private and internal fields
MemberWhat it is
private string prefabNameOriginal name of the saved object, shown on the inspector.
private SavedDynamicObject savedToolSaved data of the object to clone, or null when nothing is selected.

Properties​

MemberWhat it is
override string Name { get; }Shown on the inspector as "Cloner".

Methods​

MemberWhat it is
override void Disable()Restores teleport mode and hides the pointer line.
override void Enable(Interactable pickup, Interactor interactor)Takes over the teleport button, clears the saved object and shows the pointer line.
override void PressClearAsync()Server: spawns a clone of the saved object one metre along the pointer, in the inspector's chunk.
override void PressDown()Does nothing for this tool.
override void PressUp()Does nothing for this tool.
override void ReceiveAngle(float angle)Does nothing for this tool.
override void ReceiveInput(PlayerInput controller)On a teleport press, raycasts and saves the hit object, walking up child-saved prefabs to the chunking parent.
override void Update()Shows what is ready to clone, or says cloning isn't possible on a client.
2 private and internal methods
MemberWhat it is
private SavedDynamicObject GetSaveOf(NetworkEntity entity)Serializes an entity's prefab with the latest chunk versioning into a SavedDynamicObject.
private NetworkEntity SpawnClone()Spawns the saved prefab unchunked and loads the saved data into it. Returns the new entity.