duck

duck

Feb 2nd, 2011
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1.  
  2. class SpaceManager : MonoBehaviour {
  3.  
  4.     Cell[,] grid;
  5.     int divisionsX = 20;
  6.     int divisionsZ = 20;
  7.    
  8.     void Start() {
  9.         grid = new Cell[divisionsX,divisionsZ];
  10.     }
  11.    
  12. }
  13.  
  14.  
  15.  
  16. class Cell {
  17.  
  18.     List<Transform> contents = new List<Transform>();
  19.    
  20.     public Add(Transform item)
  21.     {
  22.         contents.Add(item);
  23.     }
  24.  
  25.     public Remove(Transform item)
  26.     {
  27.         contents.Remove(item);
  28.     }
  29.    
  30.     public Transform[] GetContents()
  31.     {
  32.         return contents.ToArray();
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment