Looking-Glass/Assets/playerstuff/glass shader/MainCamera.cs

20 lines
484 B
C#
Raw Normal View History

2024-02-02 12:54:47 +01:00
using UnityEngine;
2024-02-07 20:26:35 +01:00
// attached to the player cameras, used to trigger the portal rendering code
2024-02-02 12:54:47 +01:00
public class MainCamera : MonoBehaviour {
public Camera ourCamera;
public WorkingPortal portal;
public WorkingPortal viewportal;
void OnPreCull () {
if(portal.myGameObject.activeInHierarchy){
portal.Render (ourCamera);
}
if(viewportal.myGameObject.activeInHierarchy){
viewportal.Render (ourCamera);
}
}
}