Generic Prefab Constructor

Initially, this script should not be attached to any gameobject as it is the base of all different type of constructors.

It contains selections (and functions) for the developer that are going to be found in any type of prefab constructor:

Variable Name

Type

Description

Prefab Perform Action

Destroy, Remain

Select if this actor after action completion should remain in the scene or if it should be destroyed.

Prefab Type

Generic, Interactable, InteractableWithParent, InteractableFinalPlacement, UseActionCollider, Question, CollisionHit, AnimationPrefab, Pump

Select the type of usage for this actor. Based on the selection here this actor will be initialized differently.

Function Name

Description

public virtual void ResetPrefab()

Resets the prefab to its starting position and rotation.

public virtual void SetNewPrefabStartingTransform()

Changes the prefabs starting position and rotation from the values the gameobject had on spawn to the values the gameobject has on the time this function is called.

public virtual void FinalizePrefabAction()

Internal function called on Action end to finalize prefabs behavior. Can be overridden to add to the prefab functionalities.