Firstborn/Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/VegetationSystemPro/VegetationPackageProModelIn...
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

60 lines
2.3 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace AwesomeTechnologies.VegetationSystem
{
public class VegetationPackageProModelInfo
{
public readonly List<VegetationItemModelInfo> VegetationItemModelList = new List<VegetationItemModelInfo>();
public readonly EnvironmentSettings EnvironmentSettings;
public VegetationPackageProModelInfo(VegetationPackagePro vegetationPackagePro, EnvironmentSettings environmentSettings, List<GameObject> windSamplerList, int cameraCount, VegetationRenderSettings vegetationRenderSettings)
{
EnvironmentSettings = environmentSettings;
for (int i = 0; i <= vegetationPackagePro.VegetationInfoList.Count - 1; i++)
{
VegetationItemModelInfo vegetationItemModelInfo =
new VegetationItemModelInfo(vegetationPackagePro.VegetationInfoList[i],EnvironmentSettings, windSamplerList,cameraCount,vegetationRenderSettings);
VegetationItemModelList.Add(vegetationItemModelInfo);
}
}
public float GetAdditionalBoundingSphereRadius()
{
float additionalBoundingSphereRadius = 0;
for (int i = 0; i <= VegetationItemModelList.Count -1; i++)
{
additionalBoundingSphereRadius = Mathf.Max(VegetationItemModelList[i].BoundingSphereRadius, additionalBoundingSphereRadius);
}
return additionalBoundingSphereRadius;
}
public void CreateCameraWindSamplerItems(List<GameObject> windSamplerList)
{
for (int i = 0; i <= VegetationItemModelList.Count -1; i++)
{
VegetationItemModelList[i].CreateCameraWindSamplerItems(windSamplerList);
}
}
public void CreateCameraBuffers(int cameraCount)
{
for (int i = 0; i <= VegetationItemModelList.Count -1; i++)
{
VegetationItemModelList[i].CreateCameraBuffers(cameraCount);
}
}
public void Dispose()
{
for (int i = 0; i <= VegetationItemModelList.Count - 1; i++)
{
VegetationItemModelList[i].Dispose();
}
VegetationItemModelList.Clear();
}
}
}