mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 19:38:24 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
using System.Text.Json.Serialization;
|
|
namespace Sandbox;
|
|
|
|
[Obsolete]
|
|
[Expose]
|
|
public struct ParticleControlPoint
|
|
{
|
|
public ControlPointValueInput Value { readonly get; set; }
|
|
|
|
public string StringCP { readonly get; set; }
|
|
|
|
[JsonInclude]
|
|
public Vector3 VectorValue { readonly get; set; }
|
|
|
|
[JsonInclude]
|
|
public float FloatValue { readonly get; set; }
|
|
|
|
[JsonInclude]
|
|
public Color ColorValue { readonly get; set; }
|
|
|
|
[JsonInclude]
|
|
public GameObject GameObjectValue { readonly get; set; }
|
|
|
|
public readonly object OutputValue()
|
|
{
|
|
switch ( Value )
|
|
{
|
|
case ControlPointValueInput.Vector3:
|
|
return VectorValue;
|
|
|
|
case ControlPointValueInput.Float:
|
|
return new Vector3( FloatValue, 0, 0 );
|
|
|
|
case ControlPointValueInput.Color:
|
|
return new Vector3( ColorValue.r, ColorValue.g, ColorValue.b );
|
|
|
|
case ControlPointValueInput.GameObject:
|
|
return GameObjectValue.IsValid() ? GameObjectValue.WorldTransform : Transform.Zero;
|
|
default:
|
|
return Vector3.Zero;
|
|
}
|
|
}
|
|
|
|
[Obsolete]
|
|
public enum ControlPointValueInput
|
|
{
|
|
GameObject,
|
|
Vector3,
|
|
Float,
|
|
Color
|
|
|
|
}
|
|
}
|