From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Export/WinRT/AppTrial.txt | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Runtime/Export/WinRT/AppTrial.txt (limited to 'Runtime/Export/WinRT') diff --git a/Runtime/Export/WinRT/AppTrial.txt b/Runtime/Export/WinRT/AppTrial.txt new file mode 100644 index 0000000..37ec8f6 --- /dev/null +++ b/Runtime/Export/WinRT/AppTrial.txt @@ -0,0 +1,56 @@ +C++RAW + +#include "UnityPrefix.h" +#include "Runtime/Mono/MonoManager.h" +#include "Runtime/Scripting/ScriptingUtility.h" +#include "Runtime/Scripting/ScriptingExportUtility.h" +#if UNITY_WINRT +#include "PlatformDependent\WinRT\ApplicationTrial.h" +#endif + +using namespace Unity; + +CSRAW + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using UnityEngineInternal; + +namespace UnityEngine.Windows +{ +CONDITIONAL UNITY_WINRT_API +CLASS LicenseInformation + + /// Returns whether the user is using App trial version (rather than full version) + CUSTOM_PROP static bool isOnAppTrial + { + #if UNITY_WINRT + return ::IsOnAppTrial (); + #else + return false; + #endif + } + + /// Windows Phone 8: + /// Redirects user to app page in the Store + /// Returns an empty string + /// Call isOnAppTrial to find out whether the user bought the app + /// + /// Windows Store apps: + /// Pops up a dialog for a user asking whether he wants to buy an app + /// If use buys an app, returns a valid purchase receipt string + CUSTOM public static string PurchaseApp () + { + #if UNITY_WINRT + return ::PurchaseApp (); + #else + return SCRIPTING_NULL; + #endif + } + +CSRAW +END + +CSRAW +} \ No newline at end of file -- cgit v1.1-26-g67d0