FRVariables

Namespace

using FlowReactor;

Draw

public virtual void Draw(bool _allowSceneObject, object[] _attributes)
// used to draw the variable in a blackboard list
public virtual void Draw(Rect rect)
Used to draw the variable in inspector
Example
#if UNITY_EDITOR
public override void Draw(bool _allowSceneObject, object[] _attributes)
{
​
if (_attributes != null)
{
var _att = _attributes.FirstOrDefault(x => x.GetType() == typeof(FRFloatRange));
​
if (_att != null)
{
var _a = _att as FRFloatRange;
Value = EditorGUILayout.Slider(Value, _a.min, _a.max);
}
else
{
Value = EditorGUILayout.FloatField(Value);
}
}
else
{
Value = EditorGUILayout.FloatField(Value);
}
}
​
public override void Draw(Rect _rect)
{
Value = EditorGUI.FloatField(_rect, Value);
}
#endif