Project File System

In this section we will introduce the project file system MAGES™ SDK utilizes.

Readers will get familiarized with the existing project structure and incentivized to work towards the same direction.

Take notes, as certain structural elements of the SDK are immutable. In other words, there is a certain structure developers are expected to store their files for the SDK to operate smoothly.

Warning

Failing to follow the structure presented in this section might lead to unexpected behaviors.

General Guideline

Everything operation specific (e.g., Action script, Lesson Prefabs, etc.) is kept under distinct structure inside the SDK.

For instance, Medical Simulation (TKA) action scripts are located at:

Assets/Samples/ORamaVR MAGES/4.0.0/Medical simulation (TKA)/ActionScripts/Lesson0/..

Action Scripts

Warning

By default, action scripts created by MAGES SDK are saved in Assets/ActionScripts/LessonX/StageY/ActionZ. Mind this when creating scripts in an imported MAGES SDK sample since there will be a mismatch in these paths.

Note

The same holds for prefabs. By default, they are saved in Assets/Resources/LessonPrefabs/LessonX/StageY/ActionZ.


Note

Notice how directories are created and named per Lesson and Alternative Lesson, and more specifically per Stage and Action.

You are strongly advised to keep the same structure for these files.

Lesson Prefabs

The provided prefab importer from the ORamaVR Platform expects a specific path for all prefabs that will be spawned at runtime.

The reason is for the pre-loader to load faster all elements without parsing on every spawn the whole file path to check whether a specific element exists inside the project.

Therefore, you cannot alter this structure!

Lesson prefabs, e.g. for Medical Simulation (TKA), are located at:

Assets/Samples/ORamaVR MAGES/4.0.0/Medical simulation (TKA)/Resources/LessonPrefabs

Pay attention that the “LessonPrefabs” folder is mandatory and should be under the Resources folder, otherwise the prefabs will not spawn.

However, the prefabs can be saved in any directory under the “LessonPrefabs” folder, the structure LessonX/StageX/ActionX is only to map the scenegraph with the folders.

Lesson Prefabs

A clear structure of the folder system regarding the lesson prefabs can be found below:

Assets
├── Samples
│   └── ORamaVR MAGES
|       └──  4.0.0
|          ├── Operation1
|          │   ├── ActionScripts
|          │   ├── Models
|          │   ├── Resources
|          |   │    ├── Analytics
|          |   │    ├── LessonPrefabs
|          |   |    │   ├── Lesson0
|          |   |    |   │   ├── Stage0
|          |   |    |   |   │   ├── Action0
|          |   |    |   |   |   │   ├── Prefab1
|          |   |    |   |   |   │   ├── Prefab2
|          |   |    |   |   |   │   ├── ...
|          |   |    |   |   |   │   └── PrefabN
|          |   |    |   |   |   ├── Action1
|          |   |    |   |   |   ├── ...
|          |   |    |   |   |   └── ActionN
|          |   |    |   |   ├── Stage1
|          |   |    |   |   ├── ...
|          |   |    |   |   └── StageN
|          |   |    |   ├── Lesson1
|          |   |    |   ├── ...
|          |   |    │   ├── LessonN
|          |   |    |   └── Optional
|          |   |    └── Storyboard
|          |   └── Scenes
|          ├── Operation2
|          ├── ...
|          └── OperationN
└── Scenes

Note

The folder structure is named after the actions they represent. For instance, all the prefabs that have to do with the first action of the second stage of the third lesson for an operation named “Test” should be placed in the following path: Assets/Samples/ORamaVR MAGES/4.0.0/Test/Resources/LessonPrefabs/Lesson2/Stage1/Action0

Warning

The folder structure numbering for actions, stages, lessons starts from zero (0).

Action Scripts

For better organization of a MAGES SDK project, it is highly recommended (although not mandatory), the action scripts to follow the same structure as of the lesson prefabs mentioned above.

It is recommended to keep the action scripts files under:

Assets/Samples/ORamaVR MAGES/4.0.0/(OperationName)/ActionScripts/..

Inside this folder it is highly recommended keeping the same structure as of the lesson prefabs (meaning LessonX/StageY/ActionZ). There, inside each Action folder, the main action script of that Action should reside.

Note

Helper functions/scripts regarding a specific action can also be placed inside the corresponding action folder.

A clear structure of the folder system regarding the action scripts can be found below:

Assets
├── Samples
│   └── ORamaVR MAGES
|       └──  4.0.0
|          ├── Operation1
|          │   ├── ActionScripts
|          |   |    ├── Lesson0
|          |   |    |   ├── Stage0
|          |   |    |   |   ├── Action0
|          |   |    |   |   |   ├── Action0Script.cs
|          |   |    |   |   |   ├── Action0Helper0.cs
|          |   |    |   |   |   ├── ...
|          |   |    |   |   |   └── Action0HelperN.cs
|          |   |    |   |   ├── Action1
|          |   |    |   |   ├── ...
|          |   |    |   |   └── ActionN
|          |   |    |   ├── Stage1
|          |   |    |   ├── ...
|          |   |    |   └── StageN
|          |   |    ├── Lesson1
|          |   |    ├── ...
|          |   |    ├── LessonN
|          |   |    └── Optional
|          │   ├── Models
|          │   ├── Resources
|          |   └── Scenes
|          ├── Operation2
|          ├── ...
|          └── OperationN
└── Scenes

Storyboard XML files

When running in Editor mode, Scenegraph is looking at a specific folder for the .xml storyboard files.

The path for this is the following:

Assets/Samples/ORamaVR MAGES/(Operation Name)/Resources/Storyboard/platform

For instance, the .xml path for the Medical Simulation (TKA) is Assets/Samples/ORamaVR MAGES/Medical simulation (TKA)/Resources/Storyboard/platform

Warning

If XML files are not in the directory above, Scenegraph will fail to load!

Note

In build the XML files can be placed under {user}/Documents/ORamaVR/Story/platform/ as described in the Build Windows section in the Getting Started guide.