Blockchain GLB

BlockchainGLB Documentation

The BlockchainGLB component allows you to download and instantiate a GLB file that is stored on the blockchain in the built version of your scene. It can be used to easily integrate blockchain assets into your Metaverse scene.

Namespace

MetaverseCloudEngine.Unity.Blockchain.Components

Public Methods

  • void Load(): Downloads and instantiates the GLB file.

Public Properties

  • BlockchainType Type: The type of blockchain that the asset is stored on.

  • string AssetID: The ID of the blockchain asset.

  • bool LoadOnStart: Whether or not to load the GLB file when the component starts.

Inspector Fields

  • BlockchainType type: The type of blockchain that the asset is stored on.

  • string assetID: The ID of the blockchain asset.

  • bool loadOnStart: Whether or not to load the GLB file when the component starts.

  • Transform parent: The parent Transform to attach the instantiated GLB GameObject to.

Behavior

  • Execution Order: This class inherits from TriInspectorMonoBehaviour, which uses the default Unity execution order.

Usage

  1. To use BlockchainGLB, start by adding the component to a GameObject in your scene.

  2. In the inspector, set the type property to the type of blockchain that the asset is stored on.

  3. Set the assetID property to the ID of the blockchain asset.

  4. Optionally, set the parent property to the Transform that you want to attach the instantiated GLB GameObject to.

  5. You can then use the Load() method to download and instantiate the GLB file.

Example:

You can use the BlockchainGLB component to download and instantiate a GLB file that represents a piece of digital art that is stored on the blockchain. To do this:

  1. Add the BlockchainGLB component to a GameObject in your scene.

  2. In the inspector, set the type property to the type of blockchain that the digital art asset is stored on.

  3. Set the assetID property to the ID of the digital art asset.

  4. Call the Load() method to download and instantiate the GLB file.

This will download and instantiate the GLB file, and the digital art will be displayed in your scene.

Additional Notes

  • The BlockchainGLB component only works in the built version of your scene. It will not work in the Unity Editor.

  • The GLB file must be stored on a blockchain network that is supported by the REACH Explorer SDK.

  • The BlockchainGLB component uses the MetaverseIpfsAPI to download the GLB file from the blockchain.

Last updated