Add enum script field support
This commit is contained in:
28
managed/GameScripts/EnumFieldProbe.cs
Normal file
28
managed/GameScripts/EnumFieldProbe.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using XCEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
public enum EnumFieldProbeState
|
||||
{
|
||||
Default = 1,
|
||||
StoredConfigured = 5,
|
||||
RuntimeUpdated = 9,
|
||||
}
|
||||
|
||||
public sealed class EnumFieldProbe : MonoBehaviour
|
||||
{
|
||||
public EnumFieldProbeState State = EnumFieldProbeState.Default;
|
||||
public int ObservedInitialState = -1;
|
||||
public bool ObservedStoredStateApplied;
|
||||
public int ObservedUpdatedState = -1;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
ObservedInitialState = (int)State;
|
||||
ObservedStoredStateApplied = State == EnumFieldProbeState.StoredConfigured;
|
||||
|
||||
State = EnumFieldProbeState.RuntimeUpdated;
|
||||
ObservedUpdatedState = (int)State;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,19 @@ using XCEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
public enum FieldMetadataProbeState
|
||||
{
|
||||
Idle = 0,
|
||||
Running = 2,
|
||||
}
|
||||
|
||||
public sealed class FieldMetadataProbe : MonoBehaviour
|
||||
{
|
||||
public int Health;
|
||||
public float Speed;
|
||||
public string Label = string.Empty;
|
||||
public Vector3 SpawnPoint;
|
||||
public FieldMetadataProbeState State = FieldMetadataProbeState.Running;
|
||||
public GameObject Target;
|
||||
public Quaternion UnsupportedRotation;
|
||||
public static int SharedCounter;
|
||||
|
||||
Reference in New Issue
Block a user