Skip to content

Commit

Permalink
[修复]1. 修复平台判断的异常处理
Browse files Browse the repository at this point in the history
  • Loading branch information
AlianBlank committed Feb 20, 2025
1 parent 0dff968 commit cb39528
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions Runtime/Helper/ApplicationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ public static bool IsAndroid
[UnityEngine.Scripting.Preserve]
public static bool IsWebGL
{
get { return Application.platform == RuntimePlatform.WebGLPlayer; }
get
{
#if UNITY_WEBGL
return true;
#else
return Application.platform == RuntimePlatform.WebGLPlayer;
#endif
}
}

/// <summary>
Expand All @@ -55,7 +62,13 @@ public static bool IsWebGL
[UnityEngine.Scripting.Preserve]
public static bool IsWindows
{
get { return Application.platform == RuntimePlatform.WindowsPlayer; }
get
{
#if UNITY_STANDALONE_WIN
return true;
#endif
return Application.platform == RuntimePlatform.WindowsPlayer;
}
}

/// <summary>
Expand All @@ -73,7 +86,13 @@ public static bool IsLinux
[UnityEngine.Scripting.Preserve]
public static bool IsMacOsx
{
get { return Application.platform == RuntimePlatform.OSXPlayer; }
get
{
#if UNITY_STANDALONE_OSX
return true;
#endif
return Application.platform == RuntimePlatform.OSXPlayer;
}
}

/// <summary>
Expand Down

0 comments on commit cb39528

Please sign in to comment.