The Action Manager can be used to combine many Action Clip and Action Manager Clip files, and output Action Manager Clip file. The Action Manager Clip can be added to Animator component. Using Animator component to play Action Manager Clip.
We use ActionState to represent Action Clip and Action Manager Clip. In code, we also make qc.ActionState class to be the base class of qc.Action and qc.ActionManager class. In addition to combining ActionState, the Action Manager also allows you to control the targetObject and loop attrib of ActionState, and also support action event.
Instruction for Action Manager
The Action Manager can be opened from the Tool/Action Manager menu, or double click Action Manager Clip file in Assets/Action folder. The following picture is the capture of Action Manager:
The Action Manager looks like the Action Editor, it is also divided into three parts. Please see the following:
The left side of the Action Manager is the Action List View.
At the top of the Action List View, there are some buttons: Play, Previous Frame, Next Frame, Add Event.
The buttom of the Action List View is the Action List. See the bellow picture. If no Action Manager Clip file is loaded, this list will be empty, the buttons in the Action List View are disabled. When an Action Manager Clip file is loaded, the action list of the Action Manager Clip will appear here.
At the right side of each action, there is a '-' button that is used to remove the action.
You can click the Add Action button to add action to this Action Manager Clip file. When clicking this button, it will popup Select Object window for choosing action. See the bellow picture.
The Select Object window lists all the Action Clip and Action Manager Clip files in the project. When choose an action, the action will be showed in the Action List.
The middle of the Action Manager is the Timeline View.
The top of the Timeline View is the timescale view. See the bellow picture:
You can click anywhere or drag red block on the timescale view to preview or modify that frame in the Action Manager Clip. The numbers in the Time Line are shown as seconds and frames, so 1:05 means 1 second and 5 frames.
The green block on the timescale view indicates the end point. You can drag green block on the timescale to modify the duration of the Action Manager Clip.
In the following Inspector View, we can control the green end line to show or hide by enable or disable the End Line checkbox. When the green end line is hided, the duration of the Action Manager Clip is the frame length that the last finished action point to. If some actions are loop, the duration is infinity.
The next line of the timescale view is the Action Event window. It's same as the Action Event window of the Action Editor. Please see Action Event window of Action Editor.
The buttom of the Timeline View is the Action Box area. See the bellow the red box of picture.
The width of box indicates the action's duration of single loop. You can drag the edge of box to modify the play speed of the action.
In the region by scrolling the mouse wheel to zoom in or zoom out timeline. When the display area is exceeded, it will show vertical slider on the right side and horizontal slider on the bottom size, drag the slider bar to view the desired display area.
If the action is loop, the box is continuously repeated. See the bellow picture:
You can drag the box to modify the start time of action. You can aslo press the left mouse button and drag to select multiple boxes or press Ctrl + left mouse button to select multiple boxes, then reposition these boxes at the same time by dragging them.
By double clicking the box or right-clicking the box, choose the Open menu item of popup menu, it will open the Action Editor or the Action Manager (It depends on the action is the Action Clip or Action Manager Clip) to edit the action.
The right side of the Action Manager is the Inspector View. The Inspector View is divided into three parts.
The top part is used to create, load, save Action Manager Clip file. See the bellow picture:
The center part is used to config properties of the Action Manager Clip. There are these properties: Name, Target Object, Target Locked, Loop, End Line, Duration. See the bellow picture:
These properties's description is the following:
Name: The action's name, the Action Manager Clip file's name by default.
Target Object: The gameObject who play the Action Manager Clip file. If it's null, the Action Manager Clip file cann't be played.
Target Locked: Whether targetObject is locked. If it's not locked, the Animator component's gameObject will be set as the targetObject of the Action Manager Clip. Or else the targetObject is fixed.
Loop: Whether the Action Manager Clip is loop.
End Line: Whether to show or hide the green end line.
Duration: The action's duration of single loop.
The buttom part is used to show action information panel and event panel.
When select an action box, the action information panel shows. We can modify the following properties of the action: Target Object, Target Locked, Loop, Speed. See the bellow picture:
When select an action event, the event panel shows, see the bellow picture. The event panel is same as that in the Action Editor. See Using Action Event.