Photon Fusion 1.1.12

Public Member Functions | List of all members
BehaviourButtonActionAttribute Class Reference

Attribute for use on Fusion.Behaviour classes. Automatically creates a button in the inspector of Behaviour derived classes. Can be used on Fields or Method member types. For fields, the name of the method the button will execute must be supplied. When used on methods, that method will be called. More...

Inherits BehaviourActionAttribute.

Public Member Functions

 BehaviourButtonActionAttribute (string buttonName, bool showWhileRunning, bool showWhileNotRunning, string conditionMember=null)
 Define a ButtonBehaviourAction. More...
 
 BehaviourButtonActionAttribute (string buttonName, string executeMethod, bool showWhileRunning, bool showWhileNotRunning, string conditionMember=null)
 Define a ButtonBehaviourAction. More...
 
 BehaviourButtonActionAttribute (string buttonName, string executeMethod=null, string conditionMember=null)
 Define a ButtonBehaviourAction. More...
 
- Public Member Functions inherited from BehaviourActionAttribute
 BehaviourActionAttribute (string conditionMember=null, ActionFlags flags=ActionFlags.ShowAtNotRuntime|ActionFlags.ShowAtRuntime)
 Define a BehaviourAction, with the action being the method this attribute is attached to. More...
 

Additional Inherited Members

- Public Types inherited from BehaviourActionAttribute
enum class  ActionFlags
 Conditions flags for when this action should run. More...
 
- Public Attributes inherited from BehaviourActionAttribute
ActionFlags ConditionFlags
 Specific flags for when this element should be displayed. More...
 
string ConditionMember
 
string ExecuteMethod
 
- Protected Member Functions inherited from BehaviourActionAttribute
 BehaviourActionAttribute (string executeMethod=null, string conditionMember=null, ActionFlags flags=ActionFlags.ShowAtNotRuntime|ActionFlags.ShowAtRuntime)
 Define a BehaviourAction. More...
 

Detailed Description

Attribute for use on Fusion.Behaviour classes. Automatically creates a button in the inspector of Behaviour derived classes. Can be used on Fields or Method member types. For fields, the name of the method the button will execute must be supplied. When used on methods, that method will be called.

Constructor & Destructor Documentation

◆ BehaviourButtonActionAttribute() [1/3]

BehaviourButtonActionAttribute ( string  buttonName,
string  executeMethod = null,
string  conditionMember = null 
)

Define a ButtonBehaviourAction.

Parameters
buttonNameThe name that will be displayed on the button.
executeMethodThe name of the method to execute. If excluded, this will be the method this attribute is on.
conditionMemberThe name of the member (in the same class) to evaluate, to determine if the action should be performed. Typically null, as the action method can have its own logic.

◆ BehaviourButtonActionAttribute() [2/3]

BehaviourButtonActionAttribute ( string  buttonName,
string  executeMethod,
bool  showWhileRunning,
bool  showWhileNotRunning,
string  conditionMember = null 
)

Define a ButtonBehaviourAction.

Parameters
buttonNameThe name that will be displayed on the button.
showWhileRunningIndicates if this button should appear while playing.
showWhileNotRunningIndicates if this button should appear while not playing.
executeMethodThe name of the method to execute. If excluded, this will be the method this attribute is on.
conditionMemberThe name of the member (in the same class) to evaluate, to determine if the action should be performed. Typically null, as the action method can have its own logic.

◆ BehaviourButtonActionAttribute() [3/3]

BehaviourButtonActionAttribute ( string  buttonName,
bool  showWhileRunning,
bool  showWhileNotRunning,
string  conditionMember = null 
)

Define a ButtonBehaviourAction.

Parameters
buttonNameThe name that will be displayed on the button.
showWhileRunningIndicates if this button should appear while playing.
showWhileNotRunningIndicates if this button should appear while not playing.
conditionMemberThe name of the member (in the same class) to evaluate, to determine if the action should be performed. Typically null, as the action method can have its own logic. This member can be a property, field or method. The return value of any of these is converted into a double. True = 1, False = 0. Null = 0.