Firstborn/Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/VegetationMasks/Areas/BroadCircleMaskArea.cs

47 lines
1.4 KiB
C#
Raw Permalink Normal View History

using AwesomeTechnologies.Vegetation;
using AwesomeTechnologies.VegetationSystem;
using Unity.Collections;
using Unity.Jobs;
namespace AwesomeTechnologies
{
public class BroadCircleMaskArea : CircleMaskArea
{
public bool MaskGrass = false;
public bool MaskPlants = false;
public bool MaskTrees = false;
public bool MaskObjects = false;
public bool MaskLargeObjects = false;
public new void Init()
{
base.Init();
RemoveGrass = MaskGrass;
RemovePlants = MaskPlants;
RemoveTrees = MaskTrees;
RemoveObjects = MaskObjects;
RemoveLargeObjects = MaskLargeObjects;
}
public override JobHandle SampleMask(VegetationInstanceData instanceData, VegetationType vegetationType,
JobHandle dependsOn)
{
if (!ExcludeVegetationType(vegetationType)) return dependsOn;
SampleVegetatiomMaskCircleJob sampleVegetatiomMaskCircleJob =
new SampleVegetatiomMaskCircleJob
{
MaskPosition = Position,
Radius = Radius,
Position = instanceData.Position,
Excluded = instanceData.Excluded
};
dependsOn = sampleVegetatiomMaskCircleJob.Schedule(instanceData.Excluded,32, dependsOn);
return dependsOn;
}
}
}