Skip to content

CM.SequenceManager

Mahdi-Movahedian-Atar edited this page Jul 3, 2023 · 3 revisions

The role of the SequenceManager is to arrange a sequence of tasks that different packages can perform without requiring direct communication between them.


Package dependencies: CM.ApplicationManagement, CM.DataManagement


SequenceManager's map

UML2 - Copy_3 (May not be 100% accurate)


Overview

What does SequenceManager do?

  • Multiple SequenceTables per sequence manager.
  • Each SequenceTable consists of multiple sequence and argument nodes. Each sequence leads to an argument, and each argument leads to one or multiple sequences.
  • SequenceTables can be deactivated, which prevents them from updating.
  • Sequence tables can contain multiple parameters of various types that can be used by sequences or arguments and can be dynamically changed.
  • The collection of sequences and arguments in a SequenceManager can be expanded to incorporate functionalities from other packages.
  • Sequences and arguments are grouped based on the package they are associated with. It is important to note that sequences or arguments from a specific package cannot be utilized in scenes that do not utilize that same package.

Standard implementation

  1. Add CM.SequenceManager to ApplicationManagerSetting (CoreMaker/ApplicationManagerSetting) (It should load before any packages that uses it).
  2. Put CM_DataManagerGameObject in \Packages\CoreMaker\Prefabs, in the scene that needs to use it.
  3. To incorporate the appropriate SequenceManagerAsset into the relevant scene within SequenceManagerSelector (CoreMaker/ApplicationManagerSetting) and select the save button.

How to use the SequenceManager

1

  1. Components
  2. Graph view

2

  1. Save the current SequenceManager Asset.
  2. Restore SequenceManager Asset to its previously saved state.
  3. Name of the current SequenceManager Asset.
  4. The SequenceManager Asset can be modified in the this location.
  5. Sequence Tables.
  6. String parameters.
  7. Integer parameters.
  8. Float parameters.
  9. Boolean parameters.

3

  1. Order of tables.
  2. Select the table to edit.
  3. Delete the table.
  4. Name of table.
  5. State of table(Active or Inactive)
  6. Add a new table.

4

  1. Delete the parameter.
  2. Name of the parameter.
  3. Value of the parameter.
  4. Add a new parameter.

5

  1. Start argument node, The sequence will begin at this node and this node cannot be deleted.
  2. Sequence Nodes, Actions will occur within this node, which can be created by right-clicking and selecting the "Create Node" option from the context menu.
  3. Argument Nodes, Logic nodes that usually have and condition to either continue or choose between output options. can be created by right-clicking and selecting the "Create Node" option from the context menu.
  4. Groups, can be created by right-clicking and selecting the "Create Node" option from the context menu. Nodes can be added or removed from a group by first holding the shift button and drag and dropping the item into the groups.

6

  1. Type of the node.
  2. Input. Each input point can accommodate multiple inputs.
  3. Output. Each output point can only have one output.
  4. Name of the node witch can be edited.
  5. Content of the node.

How to Expand the Collection of nodes based on your package

Create node classes based on the example below, ensure that the classes are placed inside the package's assembly instead of the SequenceManagers assembly:

Sequence Example


[SequenceManagerElement(typeof(CustomSequence), SequenceType.Sequence)]
public class CustomSequence : Sequence
{
	//Custom variables
	private object _exampleVariables;
		
	//Mandatory methods
	public override IEnumerator Invoke()
	{
		//This method will be invoked when this node is activated.
		//The action of the sequence must be performed at this point.
	}
	public override Sequence MakeSequence(SequenceManagerElementData elementData)
	{
		//The class will be initialized at this point.
		//Each initialized class will receive its data from `elementData`.
		//Note that a new instance of this class must be created and returned.
		return new CustomSequence();
	}
		
	//Custom methods
	private void _exampleMethod(){}
}

Argument Example

[SequenceManagerElement(typeof(CustomArgument), SequenceType.Argument)]
public class CustomArgument : Argument
{
	//Custom variables
	private object _exampleVariables;

	//Mandatory methods
	public override void EnterArgument()
	{
		//Once the argument is activated, this method will be called.
	}
	public override IEnumerator Invoke()
	{
		//This method will be called after the `EnterArgument` methods and will remain active as long as the class is active.
		//While sequence nodes are automatically updated, in arguments, we should manually update the table.
		//To update the table, you can utilize the `SequenceManager.UpdateTable()` function. The name of the table can be accessed through `this.TableName`, and the nodes that the argument can connect to can be obtained from `this.TargetSequenceName[i]`. 
		SequenceManager.UpdateTable(TableName, TargetSequenceName[i]);
		//Even if you plan to have the arguments function execute instantly, it is advisable to allow it to take at least one frame to complete in order to avoid overflowing and ensure proper processing.
		yield return null;
	}
	public override void ExitArgument()
	{
		//Once the argument is deactivated, this method will be called.
	}
	public override Argument MakeArgument(SequenceManagerElementData elementData)
	{
		//The class will be initialized at this point.
		//Each initialized class will receive its data from `elementData`.
		//Note that a new instance of this class must be created and returned.
		return new CustomArgument();
	}
 	
	//Custom methods
	private void _exampleMethod(){}
}
  • Nodes can access dynamic parameters through SequenceManager.CurrentSequenceManager. Additionally, you can access the functionality of the SequenceManager class through its static methods. I recommend reviewing the SequenceManager class in the Classes details section for more information on its capabilities and usage.

Now we need to create the UI of nodes so we can use our nodes in the SequenceManagers menu item.

Sequence Node Example

[Sequence("NodesName", "GroupsName")]
public class ExampleSequenceNode : SequenceParentNode
{
	//Mandatory Varables
	private Port _inputPort;
	private Port _outputPort;
		
	//Custom variables
	private VisualElement _exampleVisualElement;
		
	//Mandatory Mehods
	public override void CreateNode(SequenceNodeData sequenceNodeData)
	{
		//The two following values must be manually provided, or the node will not function properly.
		NodeData = sequenceNodeData;
		NodeData.TypeName = "ExampleSequenceNode";
		
		//Input ports must be placed within the `inputContainer` following the pattern below.
		_inputPort = SequenceManagerEditorUtilities.SM_Port(this, "PortsName", PortType.SequenceInput);
		inputContainer.Add(_inputPort);

		//Output ports must be placed within the `outputContainer` following the pattern below.
		_outputPort = SequenceManagerEditorUtilities.SM_Port(this, "Output", PortType.SequenceOutput);
		outputContainer.Add(_outputPort);
			
		//Create additional UI elements such as text fields, toggles, and more, and add them to the `extensionContainer` as follows.
		//Use static methods in `SequenceManagerEditorUtilities` to create UI elements.
		//Utilize `this.NodeData` to assign values to UI elements.
			
		//After adding elements to containers, the following methods should be called,
		RefreshExpandedState();
	}
	//Do not modify the following methods.
	public override void SetNode( SequenceManagerGraphView sequenceManagerGraphView)
	{
		if (NodeData.Port != -1)
		{
			sequenceManagerGraphView.Add(_outputPort.ConnectTo((Port)sequenceManagerGraphView.ArgumentParentNodes[NodeData.Port].inputContainer[0]));
		}
	}
	//This method is invoked when the Save button is pressed.
	public override SequenceNodeData SaveNode()
	{
		//The position of the node must be manually specified.
		NodeData.Vector = GetPosition().position;
			
		//Assign data from UI elements back to this.NodeData and return it.
		return NodeData;
	}
	public override SequenceManagerElementData CreateSequence()
	{
		//Create a SequenceManagerElementData and set its values from this.NodeData.
		//Please note that this data is the same data used to create the sequence in its `MakeSequence` method.
		SequenceManagerElementData exampleSequenceData = new SequenceManagerElementData;
			
		//Please make sure to specify the type of sequence that this node represents.
		exampleSequenceData.Type = typeof(ExampleSequence).ToString()
		return exampleSequenceData;
	}
		
	//Custom methods
	private void _exampleMethod(){}
}

Argument Node Example

[Argument("NodesName", "GroupsName")]
public class ExampleArgumentNode : ArgumentParentNode
{
	//Mandatory Varables
	private Port _inputPort;
	//Argument can have multiple outputs
	private Port _outputPortOne;
	private Port _outputPortTwo;
	private Port _outputPortThree;
		
	//Custom variables
	private VisualElement _exampleVisualElement;
		
	//Mandatory Mehods
	public override void CreateNode(ArgumentNodeData argumentNodeData)
	{
		//The two following values must be manually provided, or the node will not function properly.
		NodeData = argumentNodeData;
		NodeData.TypeName = "ExampleArgumentNode";
		
		//Input ports must be placed within the `inputContainer` following the pattern below.
		_inputPort = SequenceManagerEditorUtilities.SM_Port(this, "PortsName", PortType.ArgumentInput);
		inputContainer.Add(_inputPort);

		//Output ports must be placed within the `outputContainer` following the pattern below.
		_outputPortOne = SequenceManagerEditorUtilities.SM_Port(this, "PortsOne", PortType.ArgumentOutput);
		_outputPortTwo = SequenceManagerEditorUtilities.SM_Port(this, "PortsTwo", PortType.ArgumentOutput);
		_outputPortThree = SequenceManagerEditorUtilities.SM_Port(this, "PortsThree", PortType.ArgumentOutput);
		outputContainer.Add(_outputPortOne);
		outputContainer.Add(_outputPortTwo);
		outputContainer.Add(_outputPortThree);
			
		//Create additional UI elements such as text fields, toggles, and more, and add them to the `extensionContainer` as follows.
		//Use static methods in `SequenceManagerEditorUtilities` to create UI elements.
		//Utilize `this.NodeData` to assign values to UI elements.
			
		//After adding elements to containers, the following methods should be called,
		RefreshExpandedState();
	}
	//Modify the following method based on the number of output ports you have.
	public override void SetNode( SequenceManagerGraphView sequenceManagerGraphView)
	{
		if (NodeData.Ports.Count != 0)
		{
			if (NodeData.Ports[0] != -1)
			{
				sequenceManagerGraphView.Add(_outputPortOne.ConnectTo((Port)sequenceManagerGraphView.SequenceParentNodes[NodeData.Ports[0]].inputContainer[0]));
			}
			if (NodeData.Ports[1] != -1)
			{
				sequenceManagerGraphView.Add(_outputPortTwo.ConnectTo((Port)sequenceManagerGraphView.SequenceParentNodes[NodeData.Ports[1]].inputContainer[0]));
			}
			if (NodeData.Ports[2] != -1)
			{
				sequenceManagerGraphView.Add(_outputPortThree.ConnectTo((Port)sequenceManagerGraphView.SequenceParentNodes[NodeData.Ports[2]].inputContainer[0]));
			}
		}
	}
	//This method is invoked when the Save button is pressed.
	public override SequenceNodeData SaveNode()
	{
		//The position of the node must be manually specified.
		NodeData.Vector = GetPosition().position;
			
		//Assign data from UI elements back to this.NodeData and return it.
		return NodeData;
	}
	public override SequenceManagerElementData CreateArgument()
	{
		//Create a SequenceManagerElementData and set its values from this.NodeData.
		//Please note that this data is the same data used to create the sequence in its `MakeArgument` method.
		SequenceManagerElementData exampleArgumentData = new SequenceManagerElementData;
			
		//Please make sure to specify the type of argument that this node represents.
		exampleArgumentData.Type = typeof(ExampleArgument).ToString()
		return exampleArgumentData;
	}
		
	//Custom methods
	private void _exampleMethod(){}
}

SequenceManager CLasses details

Argument

All arguments must inherent from this class.

Variables

Type Name Description
public string ArgumentName Contains the name of the argument. Will be set automatically on startup.
public string TableName The table in which this argument is contained. Will be set automatically on startup.
public string[] TargetSequenceName Target sequence Nodes. Will be set automatically on startup.

Methods

Type Name Description
public abstract void EnterArgument() Will be called when the node is activated, either by updating or starting the table.
public abstract IEnumerator Invoke() It will be activated after 'EnterArgument()' is called and will be deactivated when the node is deactivated, either by updating to a new node or halting the table.
public abstract void ExitArgument() Will be called when the node is deactivated, either by updating to a new node or halting the table.
public abstract Argument MakeArgument(SequenceManagerElementData elementData) Will be called on startup to create the node.

Sequence

All sequences must inherent from this class.

Variables

Type Name Description
public string SequenceName Contains the name of the sequence. Will be set automatically on startup.
public string TableName The table in which this sequence is contained. Will be set automatically on startup.
public string TargetArgumentName Target argument Node. Will be set automatically on startup.

Methods

Type Name Description
public abstract IEnumerator Invoke() It will be activated when the node is activated.
public abstract Sequence MakeSequence(SequenceManagerElementData elementData) Will be called on startup to create the node.

SequenceManagerElementData

Attributes: Serializable

It is used to set the data of SequenceManager's nodes that will be retrieved on startup.

Variables

Type Name Description
public string Type Type of the node.
public string Name Name of the node.
public string TargetName The names of the nodes that this node will lead to.
public string Strings A string array where string variable in the node can be retrieved from.
public string Ints A integer array where integer variable in the node can be retrieved from.
public string Floats A float array where float variable in the node can be retrieved from.
public string Bools A boolean array where boolean variable in the node can be retrieved from.

SequenceTable

Contains data of a SequenceManager state machine.

Variables

Type Name Description
internal string TableName Name of the table.
internal Dictionary<string, Sequence> Sequences All sequence nodes that are contained within a table.
internal Dictionary<string, Argument> Arguments All arguments nodes that are contained within a table.
internal bool IsTableActive If table is active, if not the table wont be started.
internal bool IsTableHalted If the table is halted, when set to true, the table won't be updated.
internal string CurrentArgumentName The name of the current active argument in the table.

SequenceTableData

Attributes: Serializable

It is used to set the data of SequenceManager's tables that will be retrieved on startup.

Variables

Type Name Description
public string TableName Name of the table.
public SequenceManagerElementData[] SequenceData Data for sequence nodes.
public SequenceManagerElementData[] ArgumentData Data for argument nodes.
public bool IsTableActive If table is active.
public string CurrentArgumentName The name of the default current argument node.

SequenceManager

Inherits from: MonoBehaviour

The main function of the sequence manager.

Variables

Type Name Description
private static SequenceManager _currentSequenceManager Singleton pattern.
public static SequenceManager CurrentSequenceManager Singleton pattern.
public Dictionary<string, SequenceTable> SequenceTables All tables in the sequence manager.
public Dictionary<string, string> StringParameters String parameters that can be accessed via nodes and external classes, use for more complex functionalities.
public Dictionary<string, float> FloatParameters Float parameters that can be accessed via nodes and external classes, use for more complex functionalities.
public Dictionary<string, int> IntParameters Integer parameters that can be accessed via nodes and external classes, use for more complex functionalities.
public Dictionary<string, bool> BoolParameters Boolean parameters that can be accessed via nodes and external classes, use for more complex functionalities.

Methods

Type Name Description
public static void UpdateTable(string tableName, string targetName) Used for easier access to the _updateTable() function.
private void _updateTable(string tableName, string targetName) Used to update a specific sequence node in a specific table within the sequence manager if table is not halted.
public static void SetArgument(string tableName, string targetName) Used for easier access to the _SetArgument() function.
private void _SetArgument(string tableName, string targetName) Used to change the current argument in a specific sequence node.
public static void StartCurrentArgument(string tableName) Used for easier access to the _startCurrentArgument() function.
private void _startCurrentArgument(string tableName) Used to start a halted table if it is active.
public static void HaltCurrentArgument(string tableName) Used for easier access to the _haltCurrentArgument() function.
private void _haltCurrentArgument(string tableName) Used to halt an specific table.
public static void StartAllCurrentArguments() Used for easier access to the _startAllCurrentArguments() function.
private void _startAllCurrentArguments() Used to start all halted tables if they are active.
public static void HaltAllCurrentArguments() Used for easier access to the _haltAllCurrentArguments() function.
private void _haltAllCurrentArguments() Used to halt all tables.

SequenceManagerData

Attributes: Serializable

It is used to set the data of SequenceManager that will be retrieved on startup.

Variables

Type Name Description
public string Name Name of the SequenceManager.
public SequenceTableData[] SequenceTableData All tables contained within this SequenceManager.
public string[] StringParameterValues Values of all string parameters.
public string[] StringParameterNames Name of all string parameters.
public int[] IntParameterValues Values of all integer parameters.
public string[] IntParameterNames Name of all integer parameters.
public float[] FloatParameterValues Values of all float parameters.
public string[] FloatParameterNames Name of all float parameters.
public bool[] BoolParameterValues Values of all boolean parameters.
public string[] BoolParameterNames Name of all boolean parameters.

Methods

Type Name Description
public void SetSequenceManager() Imports the data contained within this class into the current SequenceManager.

SequenceManagerSelector

Inherits from: ScriptableObject

Attributes: Serializable

Contains all SequenceManager data for all the scenes. It is used to retrieve the current SequenceManager for the current scene.

Located in the resources folder.

Variables

Type Name Description
[SerializeField] private string[] _scenes List of all scenes.
[SerializeField] private SequenceManagerData[] _sequenceManagers List of all SequenceManagers.
public Dictionary<string, SequenceManagerData> Selector Used for easier access.

Methods

Type Name Description
public void Setup([NotNull] string[] scenes, [NotNull] SequenceManagerData[] sequenceManagers) Used to setup the class.

SequenceManagerElementAttribute

Inherits from: Attribute

Attributes: AttributeUsage(AttributeTargets.Class)

Used to create attributes of the nodes, making them easier to use.

Variables

Type Name Description
private SequenceType _sequenceType Used to specify the sequence type.
private Type _type Used to specify the type of the node by utilizing the typeof() method.
internal static Dictionary<string, Type> SequenceTypes Name of all sequence nodes with their types.
internal static Dictionary<string, Type> ArgumentTypes Name of all argument nodes with their types.

Methods

Type Name Description
internal static void Internalize() Internalize the static variables.

SequenceManagerSaveData

Inherits from: DataManagerMainObject

CM.DataManagement Implementation.

SequenceManagerStartUp

Inherits from: MonoBehaviour

Attributes: RequireComponent(typeof(SequenceManagerSaveData), typeof(SequenceManager))

CM.ApplicationManagement Implementation.

Enumerators

SequenceType

Used to specify the type of nodes.

Members Description
Sequence Node is a sequence.
Argument Node is a argument.

SequenceManagerEditor CLasses details

SequenceManagerEditorUtilities

Utilities that create UI elements and automatically apply stylesheets.

Variables

Type Name Description
private static StyleSheet _styleSheet StyleSheet of UI elements.

Methods

Type Name Description
internal static TextField SM_TextField(string value) Returns a Text Field element.
internal static IntegerField SM_IntField(int value) Returns a Integer Field element.
internal static FloatField SM_FloatField(float value) Returns a Float Field element.
internal static Toggle SM_Toggle(bool value) Returns a Toggle element.
internal static ObjectField SM_ObjectField(string label, Object value, Type type) Returns a Object Field element.
internal static Label SM_Label(string value) Returns a Label element.
internal static Button SM_Button(string label, Action clickEvent) Returns a Button element.
internal static DropdownField SM_DropdownField(List<string> choices, int index, Func<string, string> funk) Returns a Dropdown element.
internal static ScrollView SM_ScrollView(ScrollViewMode scrollViewMode) Returns a ScrollView container.
internal static Foldout SM_Foldout(string label) Returns a Foldout container.
internal static Port SM_Port(Node node, string label, PortType portType) Returns a Port element.

ArgumentParentNode

Inherits from: Node

All Argument nodes must inherit from this class.

Variables

Type Name Description
public ArgumentNodeData NodeData The data of the node should be manually set.

Methods

Type Name Description
public abstract void CreateNode(ArgumentNodeData argumentNodeData) Will be called when the node is created.
public abstract void SetNode(SequenceManagerGraphView sequenceManagerGraphView) This method will be used to set the saved data of an asset, specifically for ports.
public abstract ArgumentNodeData SaveNode() Will be called when the asset is being saved. It returns a ArgumentNodeData object to be stored in the asset.
public abstract SequenceManagerElementData CreateArgument() Will be called when the asset is being saved. It will be used to create argument nodes when the game starts.

SequenceParentNode

Inherits from: Node

All Sequence nodes must inherit from this class.

Variables

Type Name Description
public SequenceNodeData NodeData The data of the node should be manually set.

Methods

Type Name Description
public abstract void CreateNode(SequenceNodeData sequenceNodeData) Will be called when the node is created.
public abstract void SetNode(SequenceManagerGraphView sequenceManagerGraphView) This method will be used to set the saved data of an asset, specifically for ports.
public abstract SequenceNodeData SaveNode() Will be called when the asset is being saved. It returns a SequenceNodeData object to be stored in the asset.
public abstract SequenceManagerElementData CreateSequence() Will be called when the asset is being saved. It will be used to create sequence nodes when the game starts.

ArgumentNodeData

Inherits from: Node

Attributes: System.Serializable This class helps to store and retrieve data in Argument Nodes for the purpose of saving and loading assets.

Variables

Type Name Description
public string TypeName Type of the node witch uses this class.
public string NodeName Name of the node within a table, will be set automatically.
public int NodeIndex Index of the node within a table, will be set automatically.
public int GroupIndex The index of the group to which this node belongs will be set automatically. If the value is -1, it indicates that the node is not part of any group.
public Vector2 Vector The location of the node must be set manually inside the SaveNode() method of nodes that use it. You can retrieve the position of the node using GetPosition().position and assign it to a variable for saving.
public List<int> Ports The indices of ports that are connected to, must be set manually in the SetNode() method of each node that uses this class. Following the pattern mentioned in the example above.
public List<string> StringArray To store string parameters of nodes in the asset and retrieve them when the asset is loaded.
public List<int> IntArray To store integer parameters of nodes in the asset and retrieve them when the asset is loaded.
public List<float> FloatArray To store float parameters of nodes in the asset and retrieve them when the asset is loaded.
public List<bool> BoolArray To store boolean parameters of nodes in the asset and retrieve them when the asset is loaded.

SequenceNodeData

Inherits from: Node

Attributes: System.Serializable This class helps to store and retrieve data in Sequence Nodes for the purpose of saving and loading assets.

Variables

Type Name Description
public string TypeName Type of the node witch uses this class.
public string NodeName Name of the node within a table, will be set automatically.
public int NodeIndex Index of the node within a table, will be set automatically.
public int GroupIndex The index of the group to which this node belongs will be set automatically. If the value is -1, it indicates that the node is not part of any group.
public Vector2 Vector The location of the node must be set manually inside the SaveNode() method of nodes that use it. You can retrieve the position of the node using GetPosition().position and assign it to a variable for saving.
public int Port The index of the port that is connected to, must be set manually in the SetNode() method of each node that uses this class. Following the pattern mentioned in the example above. If the value is -1, it indicates that the node is not connected to other node.
public List<string> StringArray To store string parameters of nodes in the asset and retrieve them when the asset is loaded.
public List<int> IntArray To store integer parameters of nodes in the asset and retrieve them when the asset is loaded.
public List<float> FloatArray To store float parameters of nodes in the asset and retrieve them when the asset is loaded.
public List<bool> BoolArray To store boolean parameters of nodes in the asset and retrieve them when the asset is loaded.

SequenceManagerGraphView

Inherits from: GraphView

The graph view represents the sequence tables in a visual manner.

Variables

Type Name Description
public List<SequenceParentNode> SequenceParentNodes All sequence nodes contained within the table.
public List<ArgumentParentNode> ArgumentParentNodes All argument nodes contained within the table.
public List<Group> Groups All groups nodes contained within the table.

Methods

Type Name Description
public SequenceManagerGraphViewData SaveGraph() Will be called when the asset is being saved. It returns a SequenceManagerGraphViewData object to be stored in the asset.
public SequenceTableData CreateSequenceTable(string tableName, bool isTableActive) The returned sequence table will be used by the sequence manager.
public override List<Port> GetCompatiblePorts(Port startPort, NodeAdapter nodeAdapter) his sets the compatibility for ports, preventing incompatible ports from connecting to each other.
public void CreateGroup(string groupName, Vector2 location) This is used to create new groups and also to recreate the groups that were previously saved in the asset when the asset is loaded.
public void CreateSequenceNode(SequenceNodeData sequenceNodeData) This is used to create new sequence node and also to recreate the sequence node that were previously saved in the asset when the asset is loaded.
public void CreateArgumentNode(ArgumentNodeData argumentNodeData) This is used to create new argument node and also to recreate the argument node that were previously saved in the asset when the asset is loaded.
public void CreateStartNode(ArgumentNodeData argumentNodeData) This is used to set the start argument node.

SequenceManagerGraphViewData

Attributes: System.Serializable

This class helps to store and retrieve data in GraphViews for the purpose of saving and loading assets.

Variables

Type Name Description
public string GraphName The name of the table.
public List<string> Groups The names of the groups contained within this class.
public List<Vector2> GroupVector The location of the groups contained within this class.
public List<SequenceNodeData> SequenceNodeDatas The Sequence Nodes contained within this class.
public List<ArgumentNodeData> SequenceNodeDatas The Argument Nodes contained within this class.

SequenceManagerAsset

Inherits from: ScriptableObject

Attributes: CreateAssetMenu, System.Serializable The asset containing the SequenceManagers data that is saved for use by both the editor and the game component.

Variables

Type Name Description
[SerializeField] public SequenceManagerData Data Will be loaded and utilized when it is selected to be used by a scene.
[SerializeField] public string Name The names of the SequenceManager.
public List<SequenceManagerGraphViewData> GroupVector The data for the graph views that will be utilized by the editor.
public List<bool> GraphViewStateList The state for the graph views.
public List<string> StringParameterNames The names of the string parameters.
public List<string> StringParameterValues The values of the string parameters.
public List<string> IntParameterNames The names of the integer parameters.
public List<int> IntParameterValues The values of the integer parameters.
public List<string> FloatParameterNames The names of the float parameters.
public List<float> FloatParameterValues The values of the float parameters.
public List<string> BoolParameterNames The names of the boolean parameters.
public List<bool> BoolParameterValues The values of the boolean parameters.

SequenceManagerMenuItem

Inherits from: EditorWindow

The editor window to create the SequenceManager.

Variables

Type Name Description
public SequenceManagerAsset CurrentAsset The current asset being edited.
private List<SequenceManagerGraphView> _graphViews Graph views in the current current asset.
private List<bool> _isChanged If the graph with the same index has been edited.
private int _currentGraphViewIndex index of the currently selected graph. -1 if nothing is selected.
private VisualElement _graphViewContainer VisualContainer for GraphViews.
private VisualElement _toolContainer VisualContainer for other controls.
private string _name Name of the current asset.
private ScrollView _sequenceTablesContainer VisualContainer for SequenceTables. located within the '_toolContainer'.
private ScrollView _stringParametersContainer VisualContainer for string parameters. located within the '_toolContainer'.
private ScrollView _intParametersContainer VisualContainer for integer parameters. located within the '_toolContainer'.
private ScrollView _floatParametersContainer VisualContainer for float parameters. located within the '_toolContainer'.
private ScrollView _boolParametersContainer VisualContainer for boolean parameters. located within the '_toolContainer'.

Methods

Type Name Description
private void _setGraph(int index) Set the current graph.
private void _createTableContainer() Creates the '_graphViewContainer'.
private void _addTable() Adds a table.
private void _removeTable(int index) Removes the a SequenceTable.
private void _updateTableOrder() Updates the order in which the tables have been ordered.
private void _createParametersContainer() Creates the parameter containers.
private void _addParameter(int parameterIndex) Adds a parameter .
private void _removeParameter(int parameterIndex, int index) Removes a parameter.
private void _loadAsset() Loads an assets and sets it as the CurrentAsset.
private void _saveAsset() Saves the CurrentAsset.

NodeTypeGroups

Groups nodes and makes them accessible for the editor.

Variables

Type Name Description
internal static Dictionary<string, Type> SequenceTypes All sequences that have been added to this class using the 'SequenceAttribute'.
internal static Dictionary<string, string> SequenceGroups Group of sequences.
internal static Dictionary<string, Type> ArgumentTypes All argument that have been added to this class using the 'ArgumentAttribute'.
internal static Dictionary<string, string> ArgumentGroups Group of arguments.
internal static List<string> Groups List of all groups.
private static bool _isInternalized Is the class internalized.

Methods

Type Name Description
internal static void Internalize() Initializes this class.

ArgumentAttribute

Inherits from: Attribute

Attributes: AttributeUsage(AttributeTargets.Class) Argument attribute that is used to add argument nodes to the editor.

Variables

Type Name Description
internal string Name Name of the node.
internal string GroupName Group of the node.

SequenceAttribute

Inherits from: Attribute

Attributes: AttributeUsage(AttributeTargets.Class) Sequence attribute that is used to add argument nodes to the editor.

Variables

Type Name Description
internal string Name Name of the node.
internal string GroupName Group of the node.

SequenceManagerSearchWindow

Inherits from: ScriptableObject, ISearchWindowProvider

Create a search window to select nodes.

Variables

Type Name Description
private SequenceManagerGraphView _graphView Current GraphView.
private SequenceManagerMenuItem _menuItem Menu Item with this window is attached to.
private Texture2D _emptyIcon An empty image.

Methods

Type Name Description
public void Initialize(SequenceManagerGraphView sequenceManagerGraph, SequenceManagerMenuItem sequenceManagerMenuItem) Initializes this class.
public List<SearchTreeEntry> CreateSearchTree(SearchWindowContext context) Creates a search tree to be used by the SearchWindow.
public bool OnSelectEntry(SearchTreeEntry searchTreeEntry, SearchWindowContext context) Will be called when a node is selected.

SequenceManagerSelectorMenuItem

Inherits from: EditorWindow

Create a search window to set SequenceManager's data to a scene so that it can be used in-game..

Variables

Type Name Description
private ScrollView _selectorContainer Container that contains the primary functions.
private SequenceManagerSelector _selector Reference to the class that selects the current data to be used in the appropriate scene.
private List<int> _effectedIndexes Index of the scene which has been set or altered.
private string[] _scenes The name of scenes.
private SequenceManagerData[] _sequenceManagerDatas '_sequenceManagerDatas' of each seane.

Methods

Type Name Description
private ObjectField _createListElement(string scene, int index) Creates the '_selectorContainer'.
private void _Save() Saves the changes.

Enumerators

PortType

The type of ports used by 'SequenceManagerEditorUtilities' to determine the way in which the node must be created.

Members Description
ArgumentInput Input ports for argument nodes.
ArgumentOutput Output ports for argument nodes.
SequenceInput Input ports for sequence nodes.
SequenceOutput Output ports for sequence nodes.
Overview List
CM.ApplicationManagements List

CM.DataManagement List
CM.InputManagement List
CM.SequenceManager List
Clone this wiki locally