Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System.Runtime.InteropServices;
namespace PlaygroundTheory
{
public static class App
{
#if UNITY_IPHONE && !UNITY_EDITOR
[DllImport ("__Internal")]
private static extern string PTAppGetMainBundleIdentifier();
public static Func<string> GetIdentifier = _.Once(() => PTAppGetMainBundleIdentifier());
[DllImport ("__Internal")]
private static extern string PTAppGetMainBundleVersion();
public static Func<string> GetVersion = _.Once(() => PTAppGetMainBundleVersion());
[DllImport ("__Internal")]
private static extern string PTAppGetMainBundleShortVersionString();
public static Func<string> GetShortVersionString = _.Once(() => PTAppGetMainBundleShortVersionString());
#elif UNITY_ANDROID && !UNITY_EDITOR
public static Func<string> GetIdentifier = _.Once(() => "com.playgroundtheory.bonsaislice");
public static Func<string> GetVersion = _.Once(() => "1.0");
public static Func<string> GetShortVersionString = _.Once(() => "1.0");
#else
public static Func<string> GetIdentifier = _.Once(() => "com.playgroundtheory.bonsaislice");
public static Func<string> GetVersion = _.Once(() => "1.0");
public static Func<string> GetShortVersionString = _.Once(() => "1.0");
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment