Exemplo n.º 1
0
        public void UpdateVegetationMask()
        {
            if (!enabled || !gameObject.activeSelf)
            {
                return;
            }

            BeaconMaskArea maskArea = new BeaconMaskArea
            {
                Radius   = Radius,
                Position = transform.position
            };

            maskArea.SetFalloutCurve(FalloffCurve.GenerateCurveArray(4096));
            maskArea.Init();
            AddVegetationTypes(maskArea);

            if (_currentMaskArea != null)
            {
                VegetationStudioManager.RemoveVegetationMask(_currentMaskArea);
                _currentMaskArea = null;
            }

            _currentMaskArea = maskArea;
            VegetationStudioManager.AddVegetationMask(maskArea);
        }
Exemplo n.º 2
0
        public void UpdateBiomeMask()
        {
            if (!enabled || !gameObject.activeSelf)
            {
                return;
            }
            List <Vector3>   worldSpaceNodeList = GetWorldSpaceNodePositions();
            List <bool>      disableEdgeList    = GetDisableEdgeList();
            PolygonBiomeMask maskArea           = new PolygonBiomeMask {
                BiomeType = BiomeType, BlendDistance = BlendDistance, UseNoise = UseNoise, NoiseScale = NoiseScale
            };

            maskArea.AddPolygon(worldSpaceNodeList, disableEdgeList);

            if (!ValidateAnimationCurve(BlendCurve))
            {
                BlendCurve = CreateResetAnimationCurve();
            }

            if (!ValidateAnimationCurve(InverseBlendCurve))
            {
                InverseBlendCurve = CreateResetAnimationCurve();
            }

            if (!ValidateAnimationCurve(TextureBlendCurve))
            {
                TextureBlendCurve = CreateResetAnimationCurve();
            }

            maskArea.SetCurve(BlendCurve.GenerateCurveArray());
            maskArea.SetInverseCurve(InverseBlendCurve.GenerateCurveArray());
            maskArea.SetTextureCurve(TextureBlendCurve.GenerateCurveArray());

            if (_currentMaskArea != null)
            {
                VegetationStudioManager.RemoveBiomeMask(_currentMaskArea);
                _currentMaskArea = null;
            }

            _currentMaskArea = maskArea;
            VegetationStudioManager.AddBiomeMask(maskArea);

            RefreshPostProcessVolume();
        }