mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-02-04 17:50:43 +03:00
Added Friend.GetStatFloat
This commit is contained in:
parent
18fbabaf2c
commit
7c20b57957
@ -195,5 +195,21 @@ namespace Steamworks
|
|||||||
return result.HasValue && result.Value.Result == Result.OK;
|
return result.HasValue && result.Value.Result == Result.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a user stat. Must call RequestUserStats first.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="statName">The name of the stat you want to get</param>
|
||||||
|
/// <param name="defult">Will return this value if not available</param>
|
||||||
|
/// <returns>The value, or defult if not available</returns>
|
||||||
|
public float GetStatFloat( string statName, float defult = 0 )
|
||||||
|
{
|
||||||
|
var val = defult;
|
||||||
|
|
||||||
|
if ( !SteamUserStats.Internal.GetUserStat( Id, statName, ref val ) )
|
||||||
|
return defult;
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user