Browse Source

Merge pull request #54 from Zingabopp/version-fix

Fixed Application.version being called too early
pull/59/head
Anairkoen Schno 4 years ago
committed by GitHub
parent
commit
20438d3069
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 2 deletions
  1. +22
    -2
      IPA.Loader/Utilities/UnityGame.cs

+ 22
- 2
IPA.Loader/Utilities/UnityGame.cs View File

@ -28,7 +28,27 @@ namespace IPA.Utilities
_gameVersion = ver; _gameVersion = ver;
Logging.Logger.log.Debug($"GameVersion set early to {ver}"); Logging.Logger.log.Debug($"GameVersion set early to {ver}");
} }
private static string ApplicationVersionProxy => Application.version;
private static string ApplicationVersionProxy
{
get
{
try
{
return Application.version;
}
catch(MissingMemberException ex)
{
Logging.Logger.log.Error($"Tried to grab 'Application.version' too early, it's probably broken now.");
Logging.Logger.log.Debug(ex);
}
catch (Exception ex)
{
Logging.Logger.log.Error($"Error getting Application.version: {ex.Message}");
Logging.Logger.log.Debug(ex);
}
return string.Empty;
}
}
internal static void EnsureRuntimeGameVersion() internal static void EnsureRuntimeGameVersion()
{ {
try try
@ -71,7 +91,7 @@ namespace IPA.Utilities
/// <value><see langword="true"/> if the curent thread is the Unity main thread, <see langword="false"/> otherwise</value> /// <value><see langword="true"/> if the curent thread is the Unity main thread, <see langword="false"/> otherwise</value>
public static bool OnMainThread => Thread.CurrentThread.ManagedThreadId == mainThread?.ManagedThreadId; public static bool OnMainThread => Thread.CurrentThread.ManagedThreadId == mainThread?.ManagedThreadId;
internal static void SetMainThread()
internal static void SetMainThread()
=> mainThread = Thread.CurrentThread; => mainThread = Thread.CurrentThread;
/// <summary> /// <summary>


Loading…
Cancel
Save