IsAttachmentEquipped

Method

Is the attachment currently equipped?

Definition

bool IsAttachmentEquipped(string assetID)
bool IsAttachmentEquipped(string assetID)

Returns bool

Parameters

ParameterDescription
string assetID

This can be itemID, packageSKU or embeddedAssetID

Examples

public void ToggleSwordEquipped()
{
IAvatar localAvatar = SpatialBridge.actorService.localActor.avatar;

if (localAvatar.IsAttachmentEquipped("SwordAttachment"))
{
localAvatar.ClearAttachmentSlot(SpatialAvatarAttachment.Slot.RightHand);
}
else
{
localAvatar.EquipAttachment(AssetType.EmbeddedAsset, "SwordAttachment");
}
}
public void ToggleSwordEquipped()
{
IAvatar localAvatar = SpatialBridge.actorService.localActor.avatar;

if (localAvatar.IsAttachmentEquipped("SwordAttachment"))
{
localAvatar.ClearAttachmentSlot(SpatialAvatarAttachment.Slot.RightHand);
}
else
{
localAvatar.EquipAttachment(AssetType.EmbeddedAsset, "SwordAttachment");
}
}