Example #1
0
        void LateUpdateViewerHeight()
        {
            Vector3 pos = Viewpoint.position;
            float   waterHeight;

            if (CollisionProvider.SampleHeight(ref pos, out waterHeight))
            {
                ViewerHeightAboveWater = pos.y - waterHeight;
            }
        }
Example #2
0
        void LateUpdateViewerHeight()
        {
            var pos  = Viewpoint.position;
            var rect = new Rect(pos.x, pos.z, 0f, 0f);

            float waterHeight;

            if (CollisionProvider.GetSamplingData(ref rect, 0f, _samplingData) &&
                CollisionProvider.SampleHeight(ref pos, _samplingData, out waterHeight))
            {
                ViewerHeightAboveWater = pos.y - waterHeight;
            }

            CollisionProvider.ReturnSamplingData(_samplingData);
        }