SetAsset

Method

Sets the asset used by the prefab object. Successfully changing the asset will cause the gameObjects representing this prefab in the scene to be re-instantiated for all clients. The IPrefabObject instances will remain the same.

Definition

void SetAsset(AssetType assetType, string assetID)
void SetAsset(AssetType assetType, string assetID)

Parameters

ParameterDescription
AssetType assetType

The type of Spatial asset the assetID refers to.

  • BackpackItem: The itemID found in Spatial Studio
  • Package: The packageSKU found in Spatial Studio or Unity
  • EmbeddedAsset: The assetID specified in the UnitySDK.Editor.SpaceConfig in Unity Editor
string assetID

ID of the Spatial asset currently used by the prefab object.