mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-29 00:31:05 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
20 lines
461 B
C#
20 lines
461 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Sandbox
|
|
{
|
|
internal static class StyleHelpers
|
|
{
|
|
static internal float RotationDegrees( float val, string unit )
|
|
{
|
|
if ( unit.StartsWith( "grad" ) ) return val.GradiansToDegrees();
|
|
if ( unit.StartsWith( "rad" ) ) return val.RadianToDegree();
|
|
if ( unit.StartsWith( "turn" ) ) return val * 360.0f;
|
|
if ( unit.StartsWith( "deg" ) ) return val;
|
|
|
|
return val;
|
|
}
|
|
}
|
|
}
|