Initialization

How to initialize Inventool.

circle-info

Relevant Inventool namespaces:

  • using Esper.Inventool

Initialize

For some parts of Inventool to function correctly, it's required to tell it which objects are the player transform and main camera. This only needs to be called once before working with Inventool's API.

// 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 no longer required, such as when exiting the game or navigating to the main menu. Initialize will need to be called again before working with Inventool's API. This will also clear most event callbacks for all parts Inventool, so ensure your events are being set once again when required.

Last updated