Documentation for the Unity C# Library
Loading...
Searching...
No Matches
PixoPlatformUtilities.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UDebug = UnityEngine.Debug;
3
4namespace PixoVR.Apex
5{
6 public sealed class PixoPlatformUtilities : PixoSingleton<PixoPlatformUtilities>
7 {
10 {
11#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_WSA
13#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
15#elif UNITY_ANDROID
17#elif UNITY_IOS
19#else
21#endif
22 }
23
24 public static bool OpenURL(string url)
25 {
26 UDebug.Log($"PixoPlatformUtilities::OpenURL {url}");
27 return Instance.PlatformUtilities.OpenURL(url);
28 }
29
30 public static bool OpenApplication(string applicationPath, string[] argumentKeys, string[] argumentValues)
31 {
32 UDebug.Log($"PixoPlatformUtilities::OpenApplication {applicationPath}");
33 return Instance.PlatformUtilities.OpenApplication(applicationPath, argumentKeys, argumentValues);
34 }
35
36 public static void CloseCurrentApplication()
37 {
38 UDebug.Log($"PixoPlatformUtilities::CloseCurrentApplication");
39 Instance.PlatformUtilities.CloseCurrentApplication();
40 }
41
42 public static Dictionary<string, string> ParseApplicationArguments()
43 {
44 return Instance._ParseApplicationArguments();
45 }
46
47 public Dictionary<string, string> _ParseApplicationArguments()
48 {
50 }
51
52 public static bool ReadFileAsString(string fileName, out string data)
53 {
54 return Instance.PlatformUtilities.ReadFileAsString(fileName, out data);
55 }
56
57 public static bool ReadFile(string fileName, out byte[] data)
58 {
59 return Instance.PlatformUtilities.ReadFile(fileName, out data);
60 }
61
62 public static bool WriteFile(string fileName, byte[] data)
63 {
64 return Instance.PlatformUtilities.WriteFile(fileName, data);
65 }
66
67 public static bool WriteStringToFile(string fileName, string data, System.Text.Encoding encoding = null)
68 {
69 return Instance.PlatformUtilities.WriteStringToFile(fileName, data, encoding);
70 }
71
72 public static Dictionary<string, string> ParseURLArguments(string url)
73 {
74 return Instance.PlatformUtilities.ParseURLArguments(url);
75 }
76 }
77}
UnityEngine.Debug UDebug
virtual Dictionary< string, string > ParseApplicationArguments()
static bool ReadFileAsString(string fileName, out string data)
PixoGenericPlatformUtilities PlatformUtilities
static bool WriteFile(string fileName, byte[] data)
static bool WriteStringToFile(string fileName, string data, System.Text.Encoding encoding=null)
static bool ReadFile(string fileName, out byte[] data)
Dictionary< string, string > _ParseApplicationArguments()
static bool OpenApplication(string applicationPath, string[] argumentKeys, string[] argumentValues)
static Dictionary< string, string > ParseURLArguments(string url)
static Dictionary< string, string > ParseApplicationArguments()