Action Pattern Wizard

The Action Pattern Wizard is a no-code tool that simplifies the creation of various actions in MAGES SDK.

Note

The wizard currently supports the creation of Insert, Remove, Use, and Question actions.

Note

This tutorial is based on the Example Project from the MAGES Samples. If you haven’t imported it yet, refer to the Create your first MAGES Project page.

  1. In the Unity Editor, go to MAGES > MAGES Panel and click on the Scenegraph Editor tab.

../../../_images/mages_panel_initial1.png
  1. After clicking, you will be redirected to the Action Wizard. Additionally, the scenegraph editor of the active scenegraph will pop up, and you’ll have the option to activate the recommended layout. Choose as you wish.

../../../_images/scenegraph_editor_tab1.png
  1. If you select the recommended layout, your Unity Editor will be set up as follows. Click on the collapse button of the MAGES Panel to better view the wizard.

../../../_images/reccomended_layout1.png
  1. Once done, you can see the available actions, select the one you want to create, the active scene, and the active scenegraph editor. Now, you are ready to create your actions.

../../../_images/final_wizard_layout.png

Creating an Insert Action using the Action Wizard

In this tutorial, we will demonstrate how to create an insert action, specifically vaccinating a patient by inserting a syringe into the patient’s arm.

  1. Click on the Insert Action button among the available actions. The side panel displays the necessary steps to create the action. Enter your action’s name in the name property, then click the Next button to proceed.

../../../_images/insert_selection1.png
  1. After clicking Next, you will be redirected to the Setup Insert Object step. Here, you can either create a new GameObject from a model in your assets or select an existing GameObject from your assets.

../../../_images/insert_action_step21.png
  1. Click the Create New button, then select the Syringe model from your assets. This creates a GameObject of the syringe in your scene that you can position as desired. This will be the position that the GameObject will be initially spawned.

../../../_images/insert_action_step2_selectGO1.png
  1. Position the syringe on the table in your scene using the gizmos, and then click the Next button again.

../../../_images/insert_action_step2_placeGO.png
  1. You will be redirected to the final step, where you need to set up the final position of the insert object. In this step, a new GameObject of the syringe will be spawned to represent the final position.

  2. Once again, using the gizmos, move the final GameObject to the patient’s arm, where you want the syringe to be inserted, and then click the Finish button.

../../../_images/insert_action_step31.png
  1. Your insert action has been created and placed in your scenegraph as the last action, ready to be used.

../../../_images/insert_action_finish1.png
  1. Test it by pressing the play button in your Unity Editor.

Creating a Question Action using the Action Wizard

In this tutorial, we will demonstrate how to create a question action that prompts the user to specify where the syringe should be inserted to vaccinate a patient.

  1. Click on the Question Action button among the available actions. The side panel provides the necessary steps to create the action. Enter your action’s name in the name property, then click the Next button to proceed.

../../../_images/question_action1.png
  1. After clicking Next, a question template GameObject will be spawned in your scene. Move it to the desired position using the gizmos, where you want it to be spawned during playmode, and then click Next.

../../../_images/question_action_step2.png
  1. Set up the question by typing into the Question field. This text will be presented to the user during play mode. For example, you can set it to “Where should you place the syringe when vaccinating a patient?”. Then click Next.

../../../_images/question_action_step3.png
  1. Populate a list with possible answers to this question by clicking the + button. You can also select which answer is considered to be correct, and you can have more than one correct answer.

../../../_images/question_action_finalstep.png
  1. After clicking the Finish button, the question action will be created in your scenegraph as the last action.

../../../_images/question_action_finish1.png
  1. Test it by pressing the play button in your Unity Editor.

Creating a Remove Action using the Action Wizard

In this tutorial, we will demonstrate how to create a remove action that removes the syringe from the patient’s arm.

  1. Click on the Remove Action button among the available actions. The side panel provides the necessary steps to create the action. Enter your action’s name in the name property, then click the Next button to proceed.

../../../_images/remove_action1.png
  1. After clicking Next, you will be redirected to the Setup the Remove Object step. Here, you can either create a new GameObject from a model in your assets or select an existing GameObject from your assets.

../../../_images/remove_action_step2.png
  1. Click the Create New button, then select the Syringe model from your assets. This creates a GameObject of the syringe in your scene that you can position as desired. This will be the position that the GameObject will be initially spawned.

../../../_images/remove_action_step2selectGO1.png
  1. Position the syringe on the patient’s arm in your scene using the gizmos, and then click the Next button again.

../../../_images/remove_action_step2placeGO.png
  1. After clicking the Next button, the remove action will be created in your scenegraph as the last action.

../../../_images/remove_action_finish1.png
  1. Test it by pressing the play button in your Unity Editor.

Creating a Use Action using the Action Wizard

In this tutorial, we will demonstrate how to create a use action that involves using a cotton ball to clean the patient’s arm before vaccination.

  1. Click on the Use Action button among the available actions. The side panel provides the necessary steps to create the action. Enter your action’s name in the name property, then click the Next button to proceed.

../../../_images/use_action1.png
  1. After clicking Next, you will be redirected to the Setup Use Object step. Here, you can either create a new GameObject from a model in your assets or select an existing GameObject from your assets.

../../../_images/use_action_step21.png
  1. Click the Create New button, then select the Cotton_Ball model from your assets. This creates a GameObject of the cotton ball in your scene that you can position as desired. This will be the position that the GameObject will be initially spawned.

../../../_images/use_action_step2selectGO1.png
  1. Position the cotton ball on the table in your scene using the gizmos, and then click the Next button again.

../../../_images/use_action_step2placeGO.png
  1. You will be redirected to the final step of the setup, where you need to set up the use collider of the use object. In this step, a new GameObject of the Cotton Ball will be spawned to resemble the use collider.

  2. Once again, using the gizmos, move the use collider GameObject to the patient’s arm, where you want the Cotton Ball to be used, and then click the Finish button.

../../../_images/use_action_step3.png
  1. After clicking the Finish button, the use action will be created in your scenegraph as the last action.

../../../_images/use_action_finish1.png
  1. Test it by pressing the play button in your Unity Editor.