ParelVRDocs
Player site

Scripting / Reference

Economy

Types in the ParelVR.Volt.Economy namespace.

VoltEconomy#

ParelVR.Volt.Economy.VoltEconomy static

The products of this world. A script can ask what the local player owns and can ask ParelVR to offer a purchase; ParelVR shows its own confirmation and handles the payment. A script can never complete a purchase by itself and never sees another player's purchases.

VoltEconomy properties#

static bool IsAvailable { get; }

True when purchases are available in this build of ParelVR.

VoltEconomy methods#

static VoltProduct GetProduct(string productId)

A product of this world, or null.

static VoltProduct[] GetProducts()

Every product of this world.

static bool HasFailed(string productId)

True when a purchase of the product was tried this session and failed.

static bool Owns(string productId)

True once the local player's purchase of a product went through.

static void Purchase(string productId)

Asks ParelVR to offer the product to the local player. OnPurchaseCompleted follows.

VoltProduct#

ParelVR.Volt.Economy.VoltProduct class

Something this world sells. A script sees what the player sees in the shop, never payment details.

VoltProduct properties#

string Description { get; }

Description shown in the shop.

string Id { get; }

Id of the product, as set in the SDK's Monetization tab.

bool IsConsumable { get; }

True when the product can be bought more than once.

bool IsOwned { get; }

True when the local player owns the product.

string Name { get; }

Name shown in the shop.

string PriceText { get; }

The price as ParelVR shows it to this player, in their own currency.