Energy Flow Controller
The portal model with the energy cube has the Portal Activator prefab which has the Energy Flow Controller attached.
For this controller you can configure following properties:
Start value
Initial strength of the Shader when activation begins.
End value
Final strength of the Shader once the portal is fully activated.
Portal
References a GameObject with the PortalPro script attached.
The activator will enable or disable the portal based on its activation status.It also triggers any TransformScaler scripts attached to child objects of the referenced portal (see the next section for TransformScaler details).
Canvas
Canvas object of the portal activator prefab
Msg
Text message displayed on the canvas. The portal activator includes a Sphere Collider set as a trigger. When the player enters the collider, the canvas is shown, and the message provides instructions to activate or deactivate the portal.
Energy Objects
References a list of MeshRenderers using materials with the SF Energy Flow Shader. For example, in the Portal Energy Cube model, this includes the energy sphere and portal cables.
Activation duration
Number of seconds from activation start until the portal becomes active.
Activation curve
Controls the progression of the activation over time (default: linear).
Shutdown duration
Number of seconds from shutdown start until the portal is deactivated.
Shutdown curve
Controls the progression of the deactivation over time (default: linear).
TransformScaler
The TransformScaler scripts are used to scale objects based on the portal’s activation status. They are primarily used for visual effects and controlling the portal view. Here you can see where they are attached on the portal model:
When the portal is deactivated, all TransformScalers are set to the defined start values. This means that all portal particles and the ScreenHolder will be invisible (scale = 0).
When the player activates the portal, the Energy Flow Controller triggers all the TransformScalers and passes them the previously configured activation or shutdown duration. This mechanism allows the portal view and visual effects to smoothly expand on activation until they reach their maximum size after the activation duration. The same principle is applied when deactivating the portal.
Last updated