ENABLE_URP asmdef

ENABLE_URP asmdef
This commit is contained in:
ALEXTANG
2023-05-03 12:23:00 +08:00
parent 2e1bbee994
commit 64e39673d3
4 changed files with 52 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1d862c80fdc1e684e8ff3b6ae7707b79
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
using TEngine;
using UnityEngine;
#if ENABLE_URP
using UnityEngine.Rendering.Universal;
#endif
namespace GameLogic
{
public class CameraUtils
{
public static void AddCameraStack(Camera camera,Camera mainCamera)
{
#if ENABLE_URP
if (mainCamera != null)
{
// 通过脚本的方式,只要能找到 camera 不轮是否跨 base 相机的场景,都可以 Add 进 Stack
mainCamera.GetComponent<UniversalAdditionalCameraData>().cameraStack.Add(GameModule.UI.UICamera);
}
#else
Log.Fatal("Could not add camera stack because had no URP-Render-Pip");
#endif
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6375b5490bbdcc145a24706a6c4e9cb7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -5,7 +5,8 @@
"GUID:08c3762f54316454ca6b6fbcb22b40e5",
"GUID:a90b2d3377c5e4a4db95cc44fb82045e",
"GUID:aa06d4cc755c979489c256c1bcca1dfb",
"GUID:6055be8ebefd69e48b49212b09b47b2f"
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:15fc0a57446b3144c949da3e2b9737a9"
],
"includePlatforms": [],
"excludePlatforms": [],
@@ -14,6 +15,12 @@
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"versionDefines": [
{
"name": "com.unity.render-pipelines.universal",
"expression": "",
"define": "ENABLE_URP"
}
],
"noEngineReferences": false
}