Ejemplo n.º 1
0
 // ReSharper disable once UnusedMember.Local
 void OnDisable()
 {
     if (_currentMaskArea != null)
     {
         VegetationStudioManager.RemoveBiomeMask(_currentMaskArea);
         _currentMaskArea = null;
     }
 }
Ejemplo 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();
        }