Added dynamic spawning and despawning of objects
This commit is contained in:
parent
adbb208436
commit
e0cf8d9755
23 changed files with 794 additions and 350 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using Godot;
|
||||
|
||||
public class Universe
|
||||
|
|
@ -23,4 +24,22 @@ public class Universe
|
|||
{
|
||||
return Sectors[x, y, z];
|
||||
}
|
||||
|
||||
public void ForEachSector(Action<Sector> action)
|
||||
{
|
||||
int sizeX = Sectors.GetLength(0);
|
||||
int sizeY = Sectors.GetLength(1);
|
||||
int sizeZ = Sectors.GetLength(2);
|
||||
|
||||
for (int x = 0; x < sizeX; x++)
|
||||
{
|
||||
for (int y = 0; y < sizeY; y++)
|
||||
{
|
||||
for (int z = 0; z < sizeZ; z++)
|
||||
{
|
||||
action(Sectors[x, y, z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue