number portals
This commit is contained in:
@@ -14,6 +14,8 @@ namespace EscapeRoomEngine.Portal.Runtime
|
|||||||
{
|
{
|
||||||
public static readonly Matrix4x4 HalfRotation = Matrix4x4.Rotate(Quaternion.Euler(0, 180, 0));
|
public static readonly Matrix4x4 HalfRotation = Matrix4x4.Rotate(Quaternion.Euler(0, 180, 0));
|
||||||
|
|
||||||
|
private static int _portalCounter;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The portal that is connected with this one.
|
/// The portal that is connected with this one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -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.
|
/// Whether this portal is connected is determined by whether the reference to its linked portal is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal bool Connected => linkedPortal != null;
|
internal bool Connected => linkedPortal != null;
|
||||||
|
[ShowNativeProperty] internal int PortalNumber { get; private set; }
|
||||||
|
|
||||||
internal readonly List<PortalDriver> closePortalDrivers = new();
|
internal readonly List<PortalDriver> closePortalDrivers = new();
|
||||||
|
|
||||||
protected virtual void Awake()
|
protected virtual void Awake()
|
||||||
{
|
{
|
||||||
|
PortalNumber = _portalCounter++;
|
||||||
|
|
||||||
DoorEvent += (_, type) =>
|
DoorEvent += (_, type) =>
|
||||||
{
|
{
|
||||||
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
|
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
|
||||||
|
|||||||
Reference in New Issue
Block a user