From eca9f891661f5546d38319e7178a722a5ab26350 Mon Sep 17 00:00:00 2001 From: Dale Eidd Date: Thu, 13 May 2021 16:59:50 -0700 Subject: [PATCH] Don't serialise camera Validation already enforces a camera as a parent. --- crest/Assets/Crest/Crest/Scripts/Helpers/UnderwaterEffect.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crest/Assets/Crest/Crest/Scripts/Helpers/UnderwaterEffect.cs b/crest/Assets/Crest/Crest/Scripts/Helpers/UnderwaterEffect.cs index 97836160b..00e2ba731 100644 --- a/crest/Assets/Crest/Crest/Scripts/Helpers/UnderwaterEffect.cs +++ b/crest/Assets/Crest/Crest/Scripts/Helpers/UnderwaterEffect.cs @@ -43,8 +43,7 @@ public partial class UnderwaterEffect : MonoBehaviour OceanRenderer _ocean; PropertyWrapperMPB _mpb; Renderer _rend; - - [SerializeField] Camera _camera; + Camera _camera; readonly int sp_HeightOffset = Shader.PropertyToID("_HeightOffset"); @@ -61,7 +60,7 @@ private void Start() #endif _rend = GetComponent(); - _camera = transform.parent.gameObject.GetComponent(); + _camera = GetComponentInParent(); // Render before the surface mesh _rend.sortingOrder = _overrideSortingOrder ? _overridenSortingOrder : -LodDataMgr.MAX_LOD_COUNT - 1;