Portal Class

Summary

Portal is a class for controlling the behavior and properties of portal's in ASL. Portals can have different view types and materials depending on their state. This class assists the Portal Manager in portal linking and teleporting.
Namespace
ASL.PortalSystem
Base Types
  • MonoBehaviour
graph TD Base0["MonoBehaviour"]-->Type Type["Portal"] class Type type-node

Syntax

public class Portal : MonoBehaviour

Fields

Name Constant Value Summary
copyCameraPrefab
This prefab must be set in the editor to ensure the portal has a camera with preset settings to use for rendering. The camera settings can be set based on user needs.
copyCamMat
This material should be set in the editor for the portal camera to use as a render target when in an active linked state.
idleMat
This material should be set in the editor for the portal to use when in an idle state.
portalName
This string should be set on instantation to allow for finding portal instance without knowing the Photon ID assigned at runtime.
renderQuad
This GameObject must be set in the editor to ensure the portal has a quad to render to.
viewType
The view type to be used when this portal is set as a destination.
webCamMat
This material should be set in the editor for the rendering of a connected device when the portal is linked to a portal with a physical or hybrid view.

Methods

Name Value Summary
GetDest() Portal
Get the current destination portal.
Initialize(Portal.ViewType, GameObject) void
Initialize this portal to the given view type, and try to get user's camera for portal camera use.
SetPreferredDeviceName(string) void
Set the name of the device you prefer to use when this portal is set to a hybrid or physical view type.
SetUser(GameObject) void
Set the GameObject being used for the user/client position and orientation. If a camera is found within the GameObject or it's children, it will be used for the positioning and orientation of the portal camera. If no camera is found, the main camera is used.
SetViewType(Portal.ViewType) void
Set the view type to be used when this portal is set as a destination.