File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Internal/PlatformHooks/Unity Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,18 @@ internal static bool IsIOS {
147
147
}
148
148
}
149
149
150
+ /// <summary>
151
+ /// Returns true if the current platform is tvOS.
152
+ /// </summary>
153
+ internal static bool IsTvOS {
154
+ get {
155
+ if ( settingsPath == null ) {
156
+ throw new InvalidOperationException ( "Parse must be initialized before making any calls." ) ;
157
+ }
158
+ return Application . platform == RuntimePlatform . tvOS ;
159
+ }
160
+ }
161
+
150
162
/// <summary>
151
163
/// Returns true if current running platform is Windows Phone 8.
152
164
/// </summary>
@@ -230,6 +242,9 @@ private string Load() {
230
242
try {
231
243
if ( IsWebPlayer ) {
232
244
return PlayerPrefs . GetString ( "Parse.settings" , null ) ;
245
+ } else if ( IsTvOS ) {
246
+ Debug . Log ( "Running on TvOS, prefs cannot be loaded." ) ;
247
+ return null ;
233
248
} else {
234
249
using ( var fs = new FileStream ( settingsPath , FileMode . Open , FileAccess . Read ) ) {
235
250
var reader = new StreamReader ( fs ) ;
@@ -250,6 +265,8 @@ private void Save() {
250
265
if ( IsWebPlayer ) {
251
266
PlayerPrefs . SetString ( "Parse.settings" , ParseClient . SerializeJsonString ( data ) ) ;
252
267
PlayerPrefs . Save ( ) ;
268
+ } else if ( IsTvOS ) {
269
+ Debug . Log ( "Running on TvOS, prefs cannot be saved." ) ;
253
270
} else {
254
271
using ( var fs = new FileStream ( settingsPath , FileMode . Create , FileAccess . Write ) ) {
255
272
using ( var writer = new StreamWriter ( fs ) ) {
You can’t perform that action at this time.
0 commit comments