using UnityEngine; namespace BitStrap.Examples { public class ReflectionHelperExample : MonoBehaviour { [Header("Edit the fields and click the buttons to test them!")] public int intValue1 = 1; public int intValue2 = 2; public int intValue3 = 3; public string stringValue1 = "string1"; public string stringValue2 = "string2"; [Button] public void ListAllIntegerFields() { int[] fieldValuesOfType = ReflectionHelper.GetFieldValuesOfType(this); Debug.LogFormat("All Integer values: {0}", fieldValuesOfType.ToStringFull()); } [Button] public void ListAllStringFields() { string[] fieldValuesOfType = ReflectionHelper.GetFieldValuesOfType(this); Debug.LogFormat("All String values: {0}", fieldValuesOfType.ToStringFull()); } [Button] public void ListAllBooleanFields() { bool[] fieldValuesOfType = ReflectionHelper.GetFieldValuesOfType(this); Debug.LogFormat("All Boolean values: {0}", fieldValuesOfType.ToStringFull()); } } }