Class PrefabSpawningController
- Namespace
- Others
Handles the initial spawning and positioning as well as the repositioning of the training assembly.
public class PrefabSpawningController : MonoBehaviour
- Inheritance
-
objectPrefabSpawningController
Fields
instantiatedPrefab
Reference to the spawned training assembly.
public static GameObject instantiatedPrefab
Field Value
- GameObject
Gets created on runtime.
objectWasSpawned
Is the prefab spawned?
public bool objectWasSpawned
Field Value
- bool
True if spawned.
placementPoseIsValid
Is the attempted placement pose valid?
public bool placementPoseIsValid
Field Value
- bool
True if valid.
Methods
GetSpawnedObject()
Returns the instantiated prefab.
public GameObject GetSpawnedObject()
Returns
- GameObject
The instantiated prefab.
PlaceSetup()
Places the training assembly at the current placement pose, if it is valid (used by the place button).
public void PlaceSetup()
Reposition()
Restarts the positioning process to make reposition of the prefab possible.
public void Reposition()
Events
RepositionPrefab
Event that is triggered after repositioning of the training assembly.
public static event Action RepositionPrefab
Event Type
- Action
prefabSpawned
Event that is triggered after the assembly is spawned.
public static event Action prefabSpawned
Event Type
- Action