Heroes_of_Hiis/Assets/Polaris - Low Poly Ecosystem/Polaris - Low Poly Terrain .../Runtime/Scripts/Rendering/GTreeNativeData.cs

36 lines
1.2 KiB
C#
Raw Normal View History

#if GRIFFIN
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using Unity.Collections;
namespace Pinwheel.Griffin.Rendering
{
internal class GTreeNativeData : IDisposable
{
internal NativeArray<GTreeInstance> instances;
internal NativeArray<int> prototypeIndices;
internal NativeArray<Matrix4x4> trs;
internal NativeArray<byte> cullResults;
public GTreeNativeData(List<GTreeInstance> trees)
{
instances = new NativeArray<GTreeInstance>(trees.ToArray(), Allocator.Persistent);
prototypeIndices = new NativeArray<int>(trees.Count, Allocator.Persistent);
GUtilities.Fill(prototypeIndices, -1);
trs = new NativeArray<Matrix4x4>(trees.Count, Allocator.Persistent);
cullResults = new NativeArray<byte>(trees.Count, Allocator.Persistent);
}
public void Dispose()
{
GNativeArrayUtilities.Dispose(instances);
GNativeArrayUtilities.Dispose(prototypeIndices);
GNativeArrayUtilities.Dispose(trs);
GNativeArrayUtilities.Dispose(cullResults);
}
}
}
#endif