fix stencil pass

This commit is contained in:
2023-02-14 17:03:12 +01:00
parent da1837f00c
commit dd080ef541
8 changed files with 86 additions and 75 deletions

View File

@@ -4,6 +4,7 @@ using EscapeRoomEngine.Engine.Runtime.Modules;
using EscapeRoomEngine.Engine.Runtime.Utilities;
using NaughtyAttributes;
using UnityEngine;
using UnityEngine.Serialization;
namespace EscapeRoomEngine.Portal.Runtime
{
@@ -12,9 +13,10 @@ namespace EscapeRoomEngine.Portal.Runtime
/// </summary>
public class Portal : DoorState
{
private static readonly int PortalNumberProperty = Shader.PropertyToID("_PortalNumber");
public static readonly Matrix4x4 HalfRotation = Matrix4x4.Rotate(Quaternion.Euler(0, 180, 0));
private static int _portalCounter;
private static int _portalCounter = 1;
/// <summary>
/// The portal that is connected with this one.
@@ -40,6 +42,7 @@ namespace EscapeRoomEngine.Portal.Runtime
protected virtual void Awake()
{
PortalNumber = _portalCounter++;
screen.material.SetInt(PortalNumberProperty, PortalNumber);
DoorEvent += (_, type) =>
{