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

Start value for the Energy Flow Shader strength

End value

End value for the Energy Flow Shader strength

Portal

References a gameObject that has the Portal script attached

It will enable or disable the Portal script based on the portals activation status.

It also triggers all TransformScaler scripts that are attached to any child object of the references portal (TransformScaler will be explained in the next section)

Canvas

Canvas object of the portal Activator prefab

Msg

Text message of the portal activator canvas object.

The portal activator has a Sphere collider as a trigger. If the player enters this collider, the canvas will be enabled and the message will be shown with info to either activate or deactivate the portal.

Energy Objects

References a list of MeshRenderers which have Materials from the SF Energy Flow Shader assigned. In the case of our Portal model it is the Energy sphere and the portal cables

Activation duration

Seconds from activation start until portal is activated

Activation curve

Configures the curve of the duration (default is linear)

Shutdown duration

Seconds from shutdown start until portal is deactivated

Shutdown curve

Configures the curve of the duration (default is linear)

TransformScaler

The TransformScaler scripts are used for scaling different objects based on the portal's activation status. It's basically used for visual effects and for the portal view. Here you can see where they are attached on the portal model:

When the portal is deactivated, all TransformScalers will be set to the defined start values. Which means all the Portal Particles and the ScreenHolder will be invisible (since scale 0)

When the player activates the portal, the energy flow controller will trigger all the Transform scalers and pass them the previously configured activation or shutdown duration. This mechanism allows us to smoothly open and increase the portal view on activation until the view reaches the maximum size after the activation duration. The same principle is applied for deactivating the portal.

Last updated