Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SpaceManager : MonoBehaviour {
- Cell[,] grid;
- int divisionsX = 20;
- int divisionsZ = 20;
- void Start() {
- grid = new Cell[divisionsX,divisionsZ];
- }
- }
- class Cell {
- List<Transform> contents = new List<Transform>();
- public Add(Transform item)
- {
- contents.Add(item);
- }
- public Remove(Transform item)
- {
- contents.Remove(item);
- }
- public Transform[] GetContents()
- {
- return contents.ToArray();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment