Initialization

How to initialize Inventool.

Remember to use the Esper.Inventool namespace when coding with Inventool.

Initialize

The first thing to do when working with Inventool is to initialize it. For some parts of Inventool to function correctly, it's required to tell Inventool which objects are the player transform and main camera.

// playerTransform is the Transform of the player character
// mainCamera is the Camera that the player sees through
Inventool.Initialize(playerTransform, mainCamera);

Updating Player Transform and Camera

If the player transform or main camera ever change, you can let Inventool know by setting the new values.

// Set the new player transform
Inventool.playerTransform = newPlayerTransform

// Set the new main camera
Inventool.mainCamera = newMainCamera;

Terminate

To have the opposite effect of initialize, use Terminate. This is useful when Inventool's functionality is not required anymore for whatever reason. Initialize will need to be called again before working with Inventool's API. This will also clear any event callbacks for all parts Inventool, so ensure your events are being set once again when required.

Inventool.Terminate();

Last updated