-
-
Notifications
You must be signed in to change notification settings - Fork 495
Open
Description
public enum RCType
{
Int,
Float,
Bool,
String,
Long,
Json
}
[Serializable]
class ValueDetail<T>
{
public T Value;
public T defaultValue;
}
[SerializeField] RCValue[] rCValues;
[Serializable]
class RCValue
{
public string key;
public RCType valueType;
[ShowIf(nameof(IsInt))] public ValueDetail<int> intValue;
[ShowIf(nameof(IsInt))] public UnityEvent<int> onIntValueFetched;
[ShowIf(nameof(IsFloat))] public ValueDetail<float> floatValue;
[ShowIf(nameof(IsFloat))] public UnityEvent<float> onFloatValueFetched;
[ShowIf(nameof(IsBool))] public ValueDetail<bool> boolValue;
[ShowIf(nameof(IsBool))] public UnityEvent<bool> onBoolValueFetched;
[ShowIf(nameof(valueType), RCType.String)] public ValueDetail<string> stringValue;
[ShowIf(nameof(valueType), RCType.String)] public UnityEvent<string> onStringValueFetched;
[ShowIf(nameof(valueType), RCType.Long)] public ValueDetail<long> longValue;
[ShowIf(nameof(valueType), RCType.Long)] public UnityEvent<long> onLongValueFetched;
[ShowIf(nameof(valueType), RCType.Json)] public ValueDetail<string> jsonValue;
[ShowIf(nameof(valueType), RCType.Json)] public UnityEvent<string> onJsonValueFetched;
bool IsInt() => valueType == RCType.Int;
bool IsFloat() => valueType == RCType.Float;
bool IsBool() => valueType == RCType.Bool;
bool IsString() => valueType == RCType.String;
bool IsLong() => valueType == RCType.Long;
bool IsJson() => valueType == RCType.Json;
}samaelxxi and Armegalo
Metadata
Metadata
Assignees
Labels
No labels
