기술 자료

Unity Engine

Unity Engine

PurchaseApp()

Attempts to purchase the app if it is in installed in trial mode.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

public static string PurchaseApp()

Returns

Type

Description

stringPurchase receipt.

Remarks

Calling this pops up a dialog for the user asking whether they want to buy the application. If the user buys the application, returns a valid purchase receipt string. Otherwise, returns an empty string.

Examples

using UnityEngine;using UnityEngine.Windows;class MyMonoBehaviour : MonoBehaviour{ string m_Receipt; void OnGUI() { if (LicenseInformation.isOnAppTrial) { if (GUI.Button(new Rect(10, 10, 100, 40), "Buy full version")) { m_Receipt = LicenseInformation.PurchaseApp(); } } else { GUI.Label(new Rect(10, 10, 100, 40), "You have full application version installed"); } }}