mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-30 13:26:00 +02:00
GetCurFloat conversion
This commit is contained in:
parent
cacfba0d82
commit
a28fe5be7d
1 changed files with 10 additions and 2 deletions
|
@ -707,7 +707,15 @@ namespace Beefy.utils
|
||||||
public float GetCurFloat(float theDefault = 0)
|
public float GetCurFloat(float theDefault = 0)
|
||||||
{
|
{
|
||||||
Object aVal = GetCurrent();
|
Object aVal = GetCurrent();
|
||||||
if ((aVal == null) || (!(aVal is float)))
|
if (aVal == null)
|
||||||
|
return theDefault;
|
||||||
|
if (aVal is double)
|
||||||
|
return (float)(double)aVal;
|
||||||
|
if (aVal is int64)
|
||||||
|
return (float)(int64)aVal;
|
||||||
|
if (aVal is int32)
|
||||||
|
return (float)(int32)aVal;
|
||||||
|
if (!(aVal is float))
|
||||||
return theDefault;
|
return theDefault;
|
||||||
return (float)aVal;
|
return (float)aVal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue