mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
Unity fixes
This commit is contained in:
parent
c4617c5884
commit
6982d05042
@ -237,7 +237,7 @@ public Image GetCachedAvatar( AvatarSize size, ulong steamid )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( imageid == 0 || imageid == 2 )
|
||||
if ( imageid >= 0 && imageid <= 10 )
|
||||
return null;
|
||||
|
||||
var img = new Image()
|
||||
@ -333,6 +333,7 @@ internal void Cycle()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void OnPersonaStateChange( PersonaStateChange_t data )
|
||||
{
|
||||
if ( (data.ChangeFlags & 0x0040) != 0x0040 ) return; // wait for k_EPersonaChangeAvatar
|
||||
|
@ -29,7 +29,7 @@ unsafe internal bool TryLoad( SteamNative.SteamUtils utils )
|
||||
if ( utils.GetImageSize( Id, out width, out height ) == false )
|
||||
{
|
||||
IsError = true;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
var buffer = new byte[ width * height * 4 ];
|
||||
@ -39,7 +39,7 @@ unsafe internal bool TryLoad( SteamNative.SteamUtils utils )
|
||||
if ( utils.GetImageRGBA( Id, (IntPtr) ptr, buffer.Length ) == false )
|
||||
{
|
||||
IsError = true;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,13 @@ public static void ForUnity( string platform )
|
||||
}
|
||||
|
||||
IsUnity = true;
|
||||
UseThisCall = SteamNative.Platform.Os == OperatingSystem.Windows;
|
||||
|
||||
Console.WriteLine( "Facepunch.Steamworks Unity: " + platform );
|
||||
Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os );
|
||||
Console.WriteLine( "Facepunch.Steamworks Arch: " + SteamNative.Platform.Arch );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -47,7 +50,7 @@ public static void ForUnity( string platform )
|
||||
/// for releasing his shit open source under the MIT license so we can all learn and iterate.
|
||||
///
|
||||
/// </summary>
|
||||
internal static bool UseThisCall { get { return SteamNative.Platform.Os == OperatingSystem.Windows && !IsUnity; } }
|
||||
public static bool UseThisCall { get; set; } = SteamNative.Platform.Os == OperatingSystem.Windows;
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user