Skip to content

Unity Editor Functionality

Michael Dyck edited this page Sep 18, 2020 · 3 revisions

Unity Editor Functionality

Launching the Evaluation Framework in Unity and Selecting Parameters

The following graphic schemes the sequence of actions happening in Unity after launching the Unity component of the Evaluation Framework (see here) inside a Unity project:

  1. A GameObject "EvaluationFramework" is automatically created inside the current scene (see the Hierarchy window)
  2. A custom EditorWindow "EvaluationParameterManager" pops up. This window can be docked, dragged and resized as necessary
  3. Following the steps to define EvaluationParameters as described here creates a ScriptableObject "ChooseEvaluationParameter"
  4. The appereance of the ScriptableObject in the Unity inspector window is modified through a specific CustomEditor "EvaluationParameterEditor"
  5. Through C#'s Reflection library all Script Components of the selected GameObject, as well as the Component's public variables and properties are gathered and provided for selection inside the Inspector window
  6. Saving the selection stores the ScriptableObject in a specific folder and outputs the information inside the "EvaluationParameterManager" EditorWindow
  7. On completion of selecting all EvaluationParameters, an array of these parameters is stored into the "EvaluationParameterStorage" class, as well as added as a Component to the "EvaluationFramework" GameObject
  8. The same process is repeated for the selection of ObjectiveValues (and optionally ROSParameters)

Building the Project and Saving the Parameters

After defining the complete Evaluation Space, the following sequence of actions take place:

  1. The "EvaluationFramework" GameObject now holds two Components, "EvaluationParameters" and "ObjectiveValues", holding the information about all previously defined EvaluationParameters and ObjectiveValues
  2. The two classes "EvaluationParameterStorage" and "ObjectiveValueStorage" hold the same information and save the arrays of parameters into one .JSON-file, respectively, using Newtonsoft Json.NET
  3. Finally, the Unity project is built into an executable

Changing Build Settings

Following the above mentioned steps, the Unity project is automatically build into an executable in the end. Settings for building the project have to be changed inside the EvaluationParameterStorage.cs file in the BuildExecutable() function.


© Siemens AG, 2020

Author: Michael Dyck (m.dyck@gmx.net)