Skip to content

Commit

Permalink
Don't serialise camera
Browse files Browse the repository at this point in the history
Validation already enforces a camera as a parent.
  • Loading branch information
daleeidd committed May 14, 2021
1 parent 69f441e commit eca9f89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crest/Assets/Crest/Crest/Scripts/Helpers/UnderwaterEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -61,7 +60,7 @@ private void Start()
#endif
_rend = GetComponent<Renderer>();

_camera = transform.parent.gameObject.GetComponent<Camera>();
_camera = GetComponentInParent<Camera>();

// Render before the surface mesh
_rend.sortingOrder = _overrideSortingOrder ? _overridenSortingOrder : -LodDataMgr.MAX_LOD_COUNT - 1;
Expand Down

0 comments on commit eca9f89

Please sign in to comment.