/// <summary>
        /// Initializes a new instance of the <see cref="HeightStrategy"/> class.
        /// </summary>
        /// <param name="mode">The mode.</param>
        /// <param name="sampleGranularity">The sample granularity.</param>
        /// <param name="ledgeThreshold">The ledge threshold.</param>
        /// <param name="useGlobalHeightNavigationSettings">if set to <c>true</c> global height navigation settings will be used.</param>
        /// <param name="unitsHeightNavigationCapability">The global unit height navigation capability.</param>
        /// <param name="heightMapDetail">The height map detail.</param>
        public HeightStrategy(HeightSamplingMode mode, float sampleGranularity, float ledgeThreshold, bool useGlobalHeightNavigationSettings, HeightNavigationCapabilities unitsHeightNavigationCapability, HeightMapDetailLevel heightMapDetail)
        {
            switch (mode)
            {
                case HeightSamplingMode.HeightMap:
                {
                    _sampler = new HeightMapSampler();
                    break;
                }

                case HeightSamplingMode.Raycast:
                {
                    _sampler = new RaycastSampler();
                    break;
                }

                default:
                case HeightSamplingMode.NoHeightSampling:
                {
                    _sampler = new NullSampler();
                    break;
                }
            }

            this.heightMode = mode;
            this.sampleGranularity = sampleGranularity;
            this.ledgeThreshold = ledgeThreshold;
            this.useGlobalHeightNavigationSettings = useGlobalHeightNavigationSettings;
            this.unitsHeightNavigationCapability = unitsHeightNavigationCapability;
            this.heightMapDetail = heightMapDetail;
        }
Beispiel #2
0
        public HeightStrategy(HeightSamplingMode mode, float sampleGranularity, float ledgeThreshold, bool useGlobalHeightNavigationSettings, HeightNavigationCapabilities unitsHeightNavigationCapability, HeightMapDetailLevel heightMapDetail)
        {
            switch (mode)
            {
            case HeightSamplingMode.HeightMap:
            {
                _sampler = new HeightMapSampler();
                break;
            }

            case HeightSamplingMode.Raycast:
            {
                _sampler = new RaycastSampler();
                break;
            }

            case HeightSamplingMode.Spherecast:
            {
                _sampler = new SpherecastSampler();
                break;
            }

            default:
            case HeightSamplingMode.NoHeightSampling:
            {
                _sampler = new NullSampler();
                break;
            }
            }

            this.heightMode        = mode;
            this.sampleGranularity = sampleGranularity;
            this.ledgeThreshold    = ledgeThreshold;
            this.useGlobalHeightNavigationSettings = useGlobalHeightNavigationSettings;
            this.unitsHeightNavigationCapability   = unitsHeightNavigationCapability;
            this.heightMapDetail = heightMapDetail;
        }