Tool Action¶
Tool Action is referring to an Action that user has to take a tool and use it to complete the action.
Example of Tool Action Script:
public class ScratchSponzaAction : ToolAction
{
public override void Initialize()
{
SetToolActionPrefab("AlternativeLessonPrefabs/AsinouRestoration/Stage0/Action1/RoofDirt_Tool_Collider_Prefab", ToolsEnum.Scalpel);
SetErrorColliders("AlternativeLessonPrefabs/AsinouRestoration/Stage0/Action1/Colliders/ErrorColliders");
SetPhysicalColliderPrefab("AlternativeLessonPrefabs/AsinouRestoration/Stage0/Action1/Colliders/PhysicalCollider");
SetHoloObject("AlternativeLessonPrefabs/AsinouRestoration/Stage0/Action1/Hologram/hologram_scalpel");
base.Initialize();
}
}
Action Script Explanation¶
SetToolActionPrefab(string arg1, ToolsEnum tool)
This method sets the action’s object that needs to interact with the tool.
SetErrorColliders(string arg1)
This method sets the action’s error colliders. If the user hits these colliders, the collision is marked as an error.
SetPhysicalColliderPrefab(string arg1)
This sets the physical (non-triggered) colliders. These colliders are used only in this action and are removed when it is completed.
SetHoloObject(string arg1)
This sets the hologram indicating what needs to be done in this action.
Tool Action Prefab
This type of action requires the tool action colliders to be specified on the tool action prefab. These colliders are specified by selecting the Tool Collider Prefab Constructor from the prefab constructor script. When selected, the tool colliders are created automatically by the prefab constructor.