diff --git a/Assets/Portal/Runtime/Portal.cs b/Assets/Portal/Runtime/Portal.cs index 907a45b..58ad331 100644 --- a/Assets/Portal/Runtime/Portal.cs +++ b/Assets/Portal/Runtime/Portal.cs @@ -13,6 +13,8 @@ namespace EscapeRoomEngine.Portal.Runtime public class Portal : DoorState { public static readonly Matrix4x4 HalfRotation = Matrix4x4.Rotate(Quaternion.Euler(0, 180, 0)); + + private static int _portalCounter; /// /// The portal that is connected with this one. @@ -31,10 +33,14 @@ namespace EscapeRoomEngine.Portal.Runtime /// Whether this portal is connected is determined by whether the reference to its linked portal is set. /// internal bool Connected => linkedPortal != null; + [ShowNativeProperty] internal int PortalNumber { get; private set; } + internal readonly List closePortalDrivers = new(); protected virtual void Awake() { + PortalNumber = _portalCounter++; + DoorEvent += (_, type) => { // ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault