Add SerializeField private field support
This commit is contained in:
@@ -15,10 +15,12 @@ namespace Gameplay
|
||||
public string Label = string.Empty;
|
||||
public Vector3 SpawnPoint;
|
||||
public FieldMetadataProbeState State = FieldMetadataProbeState.Running;
|
||||
[SerializeField] private bool HiddenFlag = true;
|
||||
public GameObject Target;
|
||||
public Quaternion UnsupportedRotation;
|
||||
public static int SharedCounter;
|
||||
private bool HiddenFlag = true;
|
||||
private int IgnoredPrivateCounter = 7;
|
||||
public bool HiddenFlagMirror => HiddenFlag;
|
||||
public int IgnoredPrivateCounterMirror => IgnoredPrivateCounter;
|
||||
}
|
||||
}
|
||||
|
||||
32
managed/GameScripts/SerializeFieldProbe.cs
Normal file
32
managed/GameScripts/SerializeFieldProbe.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using XCEngine;
|
||||
|
||||
namespace Gameplay
|
||||
{
|
||||
public sealed class SerializeFieldProbe : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int HiddenCounter = 7;
|
||||
[SerializeField] private bool HiddenEnabled = true;
|
||||
private int IgnoredPrivateCounter = 99;
|
||||
|
||||
public int ObservedInitialHiddenCounter = -1;
|
||||
public bool ObservedInitialHiddenEnabled;
|
||||
public bool ObservedStoredValuesApplied;
|
||||
public int ObservedUpdatedHiddenCounter = -1;
|
||||
public bool ObservedUpdatedHiddenEnabled;
|
||||
public bool ObservedIgnoredPrivateCounterUntouched;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
ObservedInitialHiddenCounter = HiddenCounter;
|
||||
ObservedInitialHiddenEnabled = HiddenEnabled;
|
||||
ObservedStoredValuesApplied = HiddenCounter == 42 && !HiddenEnabled;
|
||||
ObservedIgnoredPrivateCounterUntouched = IgnoredPrivateCounter == 99;
|
||||
|
||||
HiddenCounter += 1;
|
||||
HiddenEnabled = !HiddenEnabled;
|
||||
|
||||
ObservedUpdatedHiddenCounter = HiddenCounter;
|
||||
ObservedUpdatedHiddenEnabled = HiddenEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user