fix crash on 0 instance

main
cosmonaut 2020-12-14 00:52:40 -08:00
parent 808d50ccc2
commit f5cdd0b566
1 changed files with 9 additions and 6 deletions

View File

@ -43,6 +43,8 @@ namespace Kav
} }
public void SetData() public void SetData()
{
if (InstanceCount > 0)
{ {
VertexBuffer.SetData( VertexBuffer.SetData(
InstanceDataArray, InstanceDataArray,
@ -51,6 +53,7 @@ namespace Kav
SetDataOptions.NoOverwrite SetDataOptions.NoOverwrite
); );
} }
}
public void Clear() public void Clear()
{ {