Class PortalActivation
Makes a portal — a same-scene Teleporter or a cross-scene SceneTeleporter — dormant until something activates it.
[DisallowMultipleComponent]
public class PortalActivation : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourPortalActivation
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.MemberwiseClone()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
The rules (2026-10-10). A portal is inactive until activated. A player activates it by using it while meeting ANY of its Conditions (an ability known, an item held, the placeholder HasProfessionCondition) or holding its Key; the key is designer-assigned and generated portals leave it empty. Who it then opens for is Scope, chosen per portal: the activating character only, everyone for DurationSeconds, or everyone for good. The rules are PortalActivationRules; the use is PortalGate, called by TeleportAction and SceneTeleporter before they move anyone.
Identity is (scene, PortalIndex). The index is the bit a character's activation record stores and the key of the world row, so it must be unique in its scene and never change once the scene ships — the waypoint contract, in its own index space (a waypoint and a portal may both be 0).
Look. On a client, ActiveVisual / InactiveVisual are switched from what the server reported (PortalClientStates). Both optional.
Fields
DefaultLockedMessage
The generic refusal when LockedMessage is empty.
public const string DefaultLockedMessage = "The portal is dormant. Something must awaken it."
Field Value
Properties
ActiveVisual
public GameObject ActiveVisual { get; }
Property Value
- GameObject
Conditions
public List<BaseCondition> Conditions { get; }
Property Value
ConsumeKey
public bool ConsumeKey { get; }
Property Value
DurationSeconds
public float DurationSeconds { get; }
Property Value
HasRequirements
Whether the portal names any condition or a key.
public bool HasRequirements { get; }
Property Value
InactiveVisual
public GameObject InactiveVisual { get; }
Property Value
- GameObject
Key
public BaseItemTemplate Key { get; }
Property Value
LockedMessage
public string LockedMessage { get; }
Property Value
PortalIndex
public int PortalIndex { get; }
Property Value
SceneName
The scene the portal stands in (the scene asset's name, the same in every instance).
public string SceneName { get; }
Property Value
Scope
public PortalActivationScope Scope { get; }
Property Value
Methods
AnyConditionMet(ICharacter, EventData)
Whether at least one condition passes for the player. Null entries are skipped.
public bool AnyConditionMet(ICharacter character, EventData eventData)
Parameters
characterICharactereventDataEventData
Returns
Configure(int, PortalActivationScope, float)
Sets the authored fields. The point-of-interest generator's seam; a designer edits them in the inspector.
public void Configure(int index, PortalActivationScope activationScope, float timedSeconds)
Parameters
indexintactivationScopePortalActivationScopetimedSecondsfloat
HoldsKey(ICharacter)
Whether the player carries at least one key in their inventory.
public bool HoldsKey(ICharacter character)
Parameters
characterICharacter