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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user