minesweeper_game/Library/PackageCache/com.unity.purchasing@649c6c7b3b1b/Samples~/Apple App Store - 12 UpgradeDowngradeSubscription/UserWarningAppleAppStore.cs
2025-03-15 14:30:26 -04:00

27 lines
919 B
C#

using UnityEngine;
using UnityEngine.Purchasing;
using UnityEngine.UI;
namespace Samples.Purchasing.AppleAppStore.UpgradeDowngradeSubscription
{
public class UserWarningAppleAppStore : MonoBehaviour
{
public Text warningText;
public void UpdateWarningText()
{
var currentAppStore = StandardPurchasingModule.Instance().appStore;
var warningMessage = currentAppStore != AppStore.AppleAppStore
&& currentAppStore != AppStore.MacAppStore ?
"This sample is meant to be tested using the Apple App Store.\n" +
$"The currently selected store is: {currentAppStore}.\n" +
"Build the project for iOS, tvOS, or macOS.\n\n" +
"See README for more information and instructions on how to test this sample."
: "";
warningText.text = warningMessage;
}
}
}