예제 #1
0
        private bool ShouldUnrenderRegion(Region region)
        {
            if (!_renderedRegions.ContainsKey(region.RegionNumber))
            {
                return(false);
            }

            var distance = SphereHelpers.DistanceBetweenPoints(region.Center.AsVector(), _player.transform.position,
                                                               _planet.BaseRadius);

            return(distance > UnrenderDistance);
        }
예제 #2
0
        private float CalculateRenderPriority(Region region)
        {
            if (_renderedRegions.ContainsKey(region.RegionNumber))
            {
                return(0);
            }

            var distance = SphereHelpers.DistanceBetweenPoints(region.Center.AsVector(), _player.transform.position,
                                                               _planet.BaseRadius);

            if (distance > RenderDistance)
            {
                return(0);
            }

            return(1 / distance);
        }