Class PlayMakerUtilities
Contains some utility functions related to PlayMaker
These only work in-game
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class PlayMakerUtilities
Properties
| Edit this page View SourceFSMType
The typeof(Fsm). Will be null if PlayMakerAvailable is false
Declaration
public static Type FSMType { get; }
Property Value
Type | Description |
---|---|
Type |
PlayMakerAvailable
Is playmaker avaiable? (This is only true if playing in-game)
Declaration
public static bool PlayMakerAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
PlayMakerFSMType
The typeof(PlayMakerFSM). Will be null if PlayMakerAvailable is false
Declaration
public static Type PlayMakerFSMType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Edit this page View SourceFindStateOnFSM(object, string)
Finds a state on an FSM by name.
Declaration
public static object FindStateOnFSM(object fsm, string name)
Parameters
Type | Name | Description |
---|---|---|
object | fsm | The FSM object to search |
string | name | The name of the state to find |
Returns
Type | Description |
---|---|
object | Returns the state object with the specified name, or null if not found |
GetActionData(object)
Gets action data from an state object.
Declaration
public static object GetActionData(object stateObject)
Parameters
Type | Name | Description |
---|---|---|
object | stateObject |
Returns
Type | Description |
---|---|
object | Returns the action data from the action object |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if stateObject is null |
Exception | Thrown if actionObject is not a State Object |
GetActionName(object)
Gets the name of an action object.
Declaration
public static string GetActionName(object actionObject)
Parameters
Type | Name | Description |
---|---|---|
object | actionObject | The action object to get the name from |
Returns
Type | Description |
---|---|
string | Returns the name of the action object |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if actionObject is null |
Exception | Thrown if actionObject is not an FSMStateAction |
GetAllFsmsOnObject(GameObject)
Gets the names of all PlayMakerFSM objects on a GameObject
Declaration
public static IEnumerable<string> GetAllFsmsOnObject(GameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The gameobject to check |
Returns
Type | Description |
---|---|
IEnumerable<string> | Returns the names of all PlayMakerFSM objects on the GameObject |
GetFSMOnPlayMakerComponent(Component)
Gets the "FSM" on a PlayMakerFSM
Declaration
public static object GetFSMOnPlayMakerComponent(Component playmakerComponent)
Parameters
Type | Name | Description |
---|---|---|
Component | playmakerComponent | The PlayMakerFSM to check |
Returns
Type | Description |
---|---|
object | Returns the "FSM" on the PlayMakerFSM, or null if it couldn't be found |
Exceptions
Type | Condition |
---|---|
Exception | Throws if the component isn't a PlayMakerFSM or is null |
GetFsmArray(GameObject, string, string)
Gets the Array value in a PlayMakerFSM
Declaration
public static object[] GetFsmArray(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Array variable |
Returns
Type | Description |
---|---|
object[] | Returns the Array value of the variable |
GetFsmBool(GameObject, string, string)
Gets the Bool value in a PlayMakerFSM
Declaration
public static bool GetFsmBool(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Bool variable |
Returns
Type | Description |
---|---|
bool | Returns the Bool value of the variable |
GetFsmColor(GameObject, string, string)
Gets the Color value in a PlayMakerFSM
Declaration
public static Color GetFsmColor(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Color variable |
Returns
Type | Description |
---|---|
Color | Returns the Color value of the variable |
GetFsmEnum(GameObject, string, string)
Gets the Enum value in a PlayMakerFSM
Declaration
public static Enum GetFsmEnum(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Enum variable |
Returns
Type | Description |
---|---|
Enum | Returns the Enum value of the variable |
GetFsmFloat(GameObject, string, string)
Gets the Float value in a PlayMakerFSM
Declaration
public static float GetFsmFloat(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Float variable |
Returns
Type | Description |
---|---|
float | Returns the Float value of the variable |
GetFsmGameObject(GameObject, string, string)
Gets the GameObject value in a PlayMakerFSM
Declaration
public static GameObject GetFsmGameObject(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the GameObject variable |
Returns
Type | Description |
---|---|
GameObject | Returns the GameObject value of the variable |
GetFsmInt(GameObject, string, string)
Gets the Int value in a PlayMakerFSM
Declaration
public static int GetFsmInt(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Int variable |
Returns
Type | Description |
---|---|
int | Returns the Int value of the variable |
GetFsmMaterial(GameObject, string, string)
Gets the Material value in a PlayMakerFSM
Declaration
public static Material GetFsmMaterial(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Material variable |
Returns
Type | Description |
---|---|
Material | Returns the Material value of the variable |
GetFsmObject(GameObject, string, string)
Gets the Object value in a PlayMakerFSM
Declaration
public static Object GetFsmObject(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Object variable |
Returns
Type | Description |
---|---|
Object | Returns the Object value of the variable |
GetFsmQuaternion(GameObject, string, string)
Gets the Quaternion value in a PlayMakerFSM
Declaration
public static Quaternion GetFsmQuaternion(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Quaternion variable |
Returns
Type | Description |
---|---|
Quaternion | Returns the Quaternion value of the variable |
GetFsmRect(GameObject, string, string)
Gets the Rect value in a PlayMakerFSM
Declaration
public static Rect GetFsmRect(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Rect variable |
Returns
Type | Description |
---|---|
Rect | Returns the Rect value of the variable |
GetFsmString(GameObject, string, string)
Gets the String value in a PlayMakerFSM
Declaration
public static string GetFsmString(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the String variable |
Returns
Type | Description |
---|---|
string | Returns the String value of the variable |
GetFsmTexture(GameObject, string, string)
Gets the Texture value in a PlayMakerFSM
Declaration
public static Texture GetFsmTexture(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Texture variable |
Returns
Type | Description |
---|---|
Texture | Returns the Texture value of the variable |
GetFsmVector2(GameObject, string, string)
Gets the Vector2 value in a PlayMakerFSM
Declaration
public static Vector2 GetFsmVector2(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Vector2 variable |
Returns
Type | Description |
---|---|
Vector2 | Returns the Vector2 value of the variable |
GetFsmVector3(GameObject, string, string)
Gets the Vector3 value in a PlayMakerFSM
Declaration
public static Vector3 GetFsmVector3(GameObject obj, string fsmName, string varName)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to get |
string | varName | The name of the Vector3 variable |
Returns
Type | Description |
---|---|
Vector3 | Returns the Vector3 value of the variable |
GetPlaymakerFSMOnObject(GameObject, string)
Gets a PlayMakerFSM component on an object with the specified name
Declaration
public static MonoBehaviour GetPlaymakerFSMOnObject(GameObject gameObject, string name)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | The gameObject to get the component on |
string | name | The name of the PlayMakerFSM |
Returns
Type | Description |
---|---|
MonoBehaviour | Returns the PlayMakerFSM component with the specified name, or null if it can't be found |
GetStateActions(object)
Gets actions on a state object.
Declaration
public static IEnumerable GetStateActions(object stateObject)
Parameters
Type | Name | Description |
---|---|---|
object | stateObject | The state object to get actions from |
Returns
Type | Description |
---|---|
IEnumerable | Returns an IEnumerable representing the actions on the state |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if stateObject is null |
Exception | Thrown if stateObject is not a State Object |
GetStateName(object)
Gets the name of a state object.
Declaration
public static string GetStateName(object stateObject)
Parameters
Type | Name | Description |
---|---|---|
object | stateObject | The state object to get the name from |
Returns
Type | Description |
---|---|
string | Returns the name of the state object |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if stateObject is null |
Exception | Thrown if stateObject is not a State Object |
GetStatesOnFSM(object)
Gets states on an FSM.
Declaration
public static IEnumerable GetStatesOnFSM(object fsm)
Parameters
Type | Name | Description |
---|---|---|
object | fsm | The FSM object to get states from |
Returns
Type | Description |
---|---|
IEnumerable | Returns an IEnumerable representing the states on the FSM |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if fsm is null or isn't an FSM |
SetFsmArray(GameObject, string, string, object[])
Sets the Array value in a PlayMakerFSM
Declaration
public static void SetFsmArray(GameObject obj, string fsmName, string varName, object[] value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Array variable |
object[] | value | The value to set in the Array variable |
SetFsmBool(GameObject, string, string, bool)
Sets the Bool value in a PlayMakerFSM
Declaration
public static void SetFsmBool(GameObject obj, string fsmName, string varName, bool value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Bool variable |
bool | value | The value to set in the Bool variable |
SetFsmColor(GameObject, string, string, Color)
Sets the Color value in a PlayMakerFSM
Declaration
public static void SetFsmColor(GameObject obj, string fsmName, string varName, Color value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Color variable |
Color | value | The value to set in the Color variable |
SetFsmEnum(GameObject, string, string, Enum)
Sets the Enum value in a PlayMakerFSM
Declaration
public static void SetFsmEnum(GameObject obj, string fsmName, string varName, Enum value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Enum variable |
Enum | value | The value to set in the Enum variable |
SetFsmFloat(GameObject, string, string, float)
Sets the Float value in a PlayMakerFSM
Declaration
public static void SetFsmFloat(GameObject obj, string fsmName, string varName, float value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Float variable |
float | value | The value to set in the Float variable |
SetFsmGameObject(GameObject, string, string, GameObject)
Sets the GameObject value in a PlayMakerFSM
Declaration
public static void SetFsmGameObject(GameObject obj, string fsmName, string varName, GameObject value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the GameObject variable |
GameObject | value | The value to set in the GameObject variable |
SetFsmInt(GameObject, string, string, int)
Sets the Int value in a PlayMakerFSM
Declaration
public static void SetFsmInt(GameObject obj, string fsmName, string varName, int value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Int variable |
int | value | The value to set in the Int variable |
SetFsmMaterial(GameObject, string, string, Material)
Sets the Material value in a PlayMakerFSM
Declaration
public static void SetFsmMaterial(GameObject obj, string fsmName, string varName, Material value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Material variable |
Material | value | The value to set in the Material variable |
SetFsmObject(GameObject, string, string, Object)
Sets the Object value in a PlayMakerFSM
Declaration
public static void SetFsmObject(GameObject obj, string fsmName, string varName, Object value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Object variable |
Object | value | The value to set in the Object variable |
SetFsmQuaternion(GameObject, string, string, Quaternion)
Sets the Quaternion value in a PlayMakerFSM
Declaration
public static void SetFsmQuaternion(GameObject obj, string fsmName, string varName, Quaternion value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Quaternion variable |
Quaternion | value | The value to set in the Quaternion variable |
SetFsmRect(GameObject, string, string, Rect)
Sets the Rect value in a PlayMakerFSM
Declaration
public static void SetFsmRect(GameObject obj, string fsmName, string varName, Rect value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Rect variable |
Rect | value | The value to set in the Rect variable |
SetFsmString(GameObject, string, string, string)
Sets the String value in a PlayMakerFSM
Declaration
public static void SetFsmString(GameObject obj, string fsmName, string varName, string value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the String variable |
string | value | The value to set in the String variable |
SetFsmTexture(GameObject, string, string, Texture)
Sets the Texture value in a PlayMakerFSM
Declaration
public static void SetFsmTexture(GameObject obj, string fsmName, string varName, Texture value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Texture variable |
Texture | value | The value to set in the Texture variable |
SetFsmVector2(GameObject, string, string, Vector2)
Sets the Vector2 value in a PlayMakerFSM
Declaration
public static void SetFsmVector2(GameObject obj, string fsmName, string varName, Vector2 value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Vector2 variable |
Vector2 | value | The value to set in the Vector2 variable |
SetFsmVector3(GameObject, string, string, Vector3)
Sets the Vector3 value in a PlayMakerFSM
Declaration
public static void SetFsmVector3(GameObject obj, string fsmName, string varName, Vector3 value)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The object to check |
string | fsmName | The name of the PlayMakerFSM to set |
string | varName | The name of the Vector3 variable |
Vector3 | value | The value to set in the Vector3 variable |