The demo model contains most of the Game4Automation functions. The demo functionality may change from release to release to reflect any developments in the game4automation framework. The demo model can be opened by selecting game4automation > Open demo scene:
The demo model looks like this:
The demo model can be started with the play button. You will get a Scene view and a Game View. If the Game View window is not opened, it will open automatically on start. You can navigate in the scene in both views. The Game View is a preview of the later on the compiled version of Unity. On low performance computers the Game View is a little bit slower, than in the final Player version. On good performing computers the difference is negligible.
You can navigate in the scene with the mouse or keyboard:
|Right Mouse Button||Rotate scene|
|Middle Mouse Button Wheel||Zoom in and out|
|Middle Mouse Button||Pan in a direction|
|Right Arrow Key||Move the scene to the right|
|Left Arrow Key||Move the scene to the left|
|Up Arrow Key||Move the scene up|
|Down Arrow Key||Move the scene down|
|Shift + Up Arrow Key||Zoom into the scene|
|Shift + Down Arrow Key||Zoom out of the scene|
|F1,F2,F3||Saved views which can be extended|
It is also possible to use touch navigation on mobile devices or windows computers with touch screens.
You can pan with one or two fingers. With two fingers it is possible to rotate, pan and zoom. With three fingers the scene can be tilted.
If you have a 3D mouse from 3DConnextion you can use the mouse to navigate in the 3D scene.
The demo model is also equipped with a runtime inspector and editor. You can open, close and move the inspector with the slider button. Please note, that currently all properties that you changed during runtime are not saved.
The scene hierarchy structure is like this:
And the last part of the hierarchy structure:
The first step for creating a new model, is to place the game4automation prefab into the scene. This object handles the overall settings, provides a base plate, the basic lighting and the scene navigation in game mode. You need to use this in every model you build. You can change the parameters of the base plate or the lighting by clicking on the objects. This will override the inherited properties from the game4automation Asset. For more information about Prefabs and inheritance please check the Unity documentation about Prefabs or check the Unity video tutorial .
The demo model is based on several pre-prepared 3D components like the conveyor, the handling system and the robot. These components were created just for demo purposes and were not directly imported from a CAD system, as it is problematic to distribute another compnay’s CAD data. They were prepared using PIXYZ (for more information see Import 3D Data ). Workflow and model structure would be same for models based on CAD data. The 3D components in the demo scene are Handling, ConveyorCan, ConveorBox, Cabinet, Robot)
The model is equiped with one demonstration Interface. It is an S7 Interface to the Siemens Controller. For more information about interfaces please check Section Interface.
For demo purposes, in the demo model the interface is turned off so that the model can run in the absence of any external software connections. Nevertheless, signals are created for the interface, and the full model is controlled by a script substituting for a PLC, to handle the signal events.
Each interface can be of a certain type (S7TCP, Shared Memory, PLCSIM Advanced and so on) and can contain several signals. Signals are usually imported from the counterpart of the interface (for example if Simit is up and runnning, the signals can be automatically imported from Simit) or signals can be manually created based on the prefabs. See more about Signals and Signal types in Section Interface.
In the model you will find several signals, for example CanGripperClosed,GantryYStart and so on. On a signal you always see the signal value in the Hierarchy view. For example False and True for boolean signals. PLC-Inputs (which means outputs from Unity) are in red. PLC-Outputs (which means inputs to Unity) are in green.
The objects, which are moving based on Physics, are called MU (= movable unit) in Game4Automation. The model has two sources. One for the cans (CAN) and one for the blue plastic box (PlasticBox). The sources are replicate the 3D component on which they are based. It is always good practice, to place the newly created MUs as sub object of a special object in the hierarchy. In the demo model this is the object MU. During simulation runtime you will find all dynamically created MUs under MU. For more information about MUs please check section Source.
Because we don’t have real PLCs connected to the demo model, we programmed some simple control logics to drive the model. These control logics are communicating with the behavior models of the drives and sensors by using the Signals in the interface section.
Please note, that the control logics inside the model are using signals for controlling the model mainly for demo purposes. If you just want to control the model, you can also control the public properties on the drives or sensors directly. See more in Section PLC.
You can add UI components to a scene. These UI components can be connected to signal inputs or outputs of the PLC. For example, this is very useful when you want to replace real buttons with virtual ones in your model. In the UI components you find several elements to control the model. During simulation you can see in the Game-Window the UI elements:
The UI elements can be opened and closed by clicking on the Control tab in the screen. Additional buttons and tabs can be added to your own models as you would like.