📖
FlowReactor
  • 👋Welcome
  • Installation
  • Interface
    • Graph Library
    • Graph Explorer
  • FlowReactorComponent
  • Settings
  • Addons / Packages
  • Guides
    • Introduction
    • Create custom node
    • Variables & Blackboards
      • Type conversions
    • Using the EventSystem
      • Sequencing Events
  • In-depth
    • Node Attributes
    • Long running nodes
    • Node Modules
      • FRNodeControllable
      • FRNodeEventDispatcher
      • Custom node utility modules
    • Assembly Defintion
  • API
    • Nodes
    • Blackboard
    • Eventboard
    • FlowReactorComponent
    • FRVariables
      • FREnum
      • FRAttributes
    • INodeControllable
Powered by GitBook
On this page
  • Namespace
  • Draw
  1. API

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
PreviousFlowReactorComponentNextFREnum

Last updated 2 years ago