浏览代码

* Added XR tweak to disable screen space canvas as well as URP sky.

/boatattack-xr-add-xr-support
thomas-zeng 4 年前
当前提交
3b48cc71
共有 6 个文件被更改,包括 264 次插入0 次删除
  1. 154
      Assets/Objects/Levels/Island/ClearSky/BuiltinSky.mat
  2. 8
      Assets/Objects/Levels/Island/ClearSky/BuiltinSky.mat.meta
  3. 46
      Assets/Objects/misc/XRTweak.prefab
  4. 7
      Assets/Objects/misc/XRTweak.prefab.meta
  5. 38
      Assets/XRTweak.cs
  6. 11
      Assets/XRTweak.cs.meta

154
Assets/Objects/Levels/Island/ClearSky/BuiltinSky.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BuiltinSky
m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _SUNDISK_HIGH_QUALITY
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BackTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DownTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FrontTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LeftTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RightTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _UpTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 0
- _AtmosphereThickness: 1
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _Exposure: 1.3
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SunDisk: 2
- _SunSize: 0.04
- _SunSizeConvergence: 5
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _GroundColor: {r: 0.36899996, g: 0.34899998, b: 0.34099993, a: 1}
- _SkyTint: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &8580588156654345313
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 3

8
Assets/Objects/Levels/Island/ClearSky/BuiltinSky.mat.meta


fileFormatVersion: 2
guid: 9f294e37142d69a4ebdc5dd07eee59f8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

46
Assets/Objects/misc/XRTweak.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7648190283397730052
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7648190283397730054}
- component: {fileID: 7089690215496180645}
m_Layer: 0
m_Name: XRTweak
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7648190283397730054
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7648190283397730052}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -70.55728, y: 3.088983, z: -52.498493}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7089690215496180645
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7648190283397730052}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e45e55c90b4b9bd48afcbf4af559f635, type: 3}
m_Name:
m_EditorClassIdentifier:
BuiltinSky: {fileID: 2100000, guid: 9f294e37142d69a4ebdc5dd07eee59f8, type: 2}

7
Assets/Objects/misc/XRTweak.prefab.meta


fileFormatVersion: 2
guid: e40d347d116685f44a4079b688cfcb88
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

38
Assets/XRTweak.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Management;
namespace BoatAttack
{
public class XRTweak : MonoBehaviour
{
public Material BuiltinSky;
private static bool disableRaceUI = false;
public static bool DisableRaceUI()
{
return disableRaceUI;
}
// Start is called before the first frame update
void Start()
{
if(XRGeneralSettings.Instance.InitManagerOnStart)
{
// URP XR requires built-in shader includes. Swap skybox material to use builtin skybox
RenderSettings.skybox = BuiltinSky;
// Disable Screenspace Canvas for XR because it is not supported.
disableRaceUI = true;
}
}
// Update is called once per frame
void Update()
{
}
}
}

11
Assets/XRTweak.cs.meta


fileFormatVersion: 2
guid: e45e55c90b4b9bd48afcbf4af559f635
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存