Version: 
PiXYZ Plugin for Unity
Scripting API Documentation
ActionBase
Inheritance diagram for ActionBase:
ActionIn< Input > ActionInOut< Input, Output > ActionOut< Output >

Public Member Functions

virtual string [] getErrors ()
 
virtual string [] getWarnings ()
 
virtual string [] getInfos ()
 
virtual void onBeforeDraw ()
 
void initialize ()
 
object invoke (object data)
 

Public Attributes

bool isInRuleEngine => !string.IsNullOrEmpty(menuPathRuleEngine)
 
bool isInToolbox => !string.IsNullOrEmpty(menuPathToolbox) && inputType == typeof(IList<GameObject>) && outputType == typeof(IList<GameObject>)
 

Properties

abstract int id [get]
 
virtual string menuPathRuleEngine [get]
 
virtual string menuPathToolbox [get]
 
virtual string tooltip [get]
 
abstract Type inputType [get]
 
abstract Type outputType [get]
 
FieldInstance [] fieldInstances [get]
 
MethodInfo [] helpersMethods [get]
 
string displayNameRuleEngine [get]
 
string displayNameToolbox [get]
 

Detailed Description

This is the very base class for all RuleEngine and Toolbox Actions.

Member Function Documentation

◆ getErrors()

virtual string [] getErrors ( )
virtual

Virtual method for Error checks before execution.

Returning a non null string array will display each string as an Error on the RuleEngine and Toolbox.

Returns

◆ getInfos()

virtual string [] getInfos ( )
virtual

Virtual method for Info checks before execution.

Returning a non null string array will display each string as an Information on the RuleEngine and Toolbox.

Returns

◆ getWarnings()

virtual string [] getWarnings ( )
virtual

Virtual method for Warning checks before execution.

Returning a non null string array will display each string as a Warning on the RuleEngine and Toolbox.

Returns

◆ initialize()

void initialize ( )

Initialize parameters from RuleEngineParameters attributes.

◆ invoke()

object invoke ( object  data)

Runs the action through reflection

Parameters
data
Returns

Takes the generic type Builds an instance an run !

◆ onBeforeDraw()

virtual void onBeforeDraw ( )
virtual

Virtual method for implementing operations before the Action gets drawn in the RuleEngine or the Toolbox.

Member Data Documentation

◆ isInRuleEngine

bool isInRuleEngine => !string.IsNullOrEmpty(menuPathRuleEngine)

Returns true if this Action is available trough the RuleEngine.

◆ isInToolbox

bool isInToolbox => !string.IsNullOrEmpty(menuPathToolbox) && inputType == typeof(IList<GameObject>) && outputType == typeof(IList<GameObject>)

Returns true if this Action is available trough the Toolbox.

Property Documentation

◆ displayNameRuleEngine

string displayNameRuleEngine
get

Returns the display name (without menu path).

◆ displayNameToolbox

string displayNameToolbox
get

Returns the display name (without menu path)

◆ fieldInstances

FieldInstance [] fieldInstances
get

Eventual fields.

Fields can be added for an Action implementation thanks to the attribute PiXYZ.Plugin.Unity.Tools.UserParameter.

◆ helpersMethods

MethodInfo [] helpersMethods
get

Eventual helper methods.

Helper methods can be added for an Action implementation thanks to the attribute PiXYZ.Plugin.Unity.Tools.HelperMethod.

◆ id

abstract int id
get

The id of the Acton implementation.

This id should be unique and is readonly (written in code). The id is the actual reference if the Action is serialized (in a set of RuleEngine Rules for example), hence, this shouldn't be changed if possible when someone uses it.

◆ inputType

abstract Type inputType
get

Specifies what kind of data enters your actions.

(Eg: IList<GameObject>, IList<Material>, Mesh, string[], ...)

◆ menuPathRuleEngine

virtual string menuPathRuleEngine
get

The menu path for the RuleEngine.

Use forward slashes for submenus (ex:"Custom/My Custom Action") If left null or empty, this Action won't be listed in the RuleEngine.

◆ menuPathToolbox

virtual string menuPathToolbox
get

The menu path for the Toolbox.

Use forward slashes for submenus (ex:"Custom/My Custom Action") If left null or empty, this Action won't be listed in the Toolbox.

◆ outputType

abstract Type outputType
get

Specifies what kind of data the actions outputs.

(Eg: IList<GameObject>, IList<Material>, Mesh, string[], ...)

◆ tooltip

virtual string tooltip
get

Returns the tooltip.