Exemplo n.º 1
0
 public void SetZones(Vector2 coordinates, Vector2 size, DiggableZone zone)
 {
     for (int y = 0; y < size.y; y++) {
         for (int x = 0; x < size.x; x++) {
             SetZone(new Vector2(coordinates.x + x, coordinates.y + y), zone);
         }
     }
 }
Exemplo n.º 2
0
        public DiggableZone(Vector2 coordinates, Vector2 size, DiggableZone parent, Diggable diggable)
        {
            this.rect = new Rect(coordinates.x, coordinates.y, size.x, size.y);
            this.parent = parent;
            this.diggable = diggable;

            smallestZone = size.x <= 1;
        }
Exemplo n.º 3
0
        public void Initialize(Diggable diggable)
        {
            this.diggable = diggable;

            zones = new DiggableZone[diggable.Width * diggable.Height];
            DiggableZone originalZone = new DiggableZone(Vector2.zero, new Vector2(diggable.Width, diggable.Height), null, diggable);

            originalZone.Update();
        }
Exemplo n.º 4
0
        public void Initialize(Diggable diggable)
        {
            this.diggable = diggable;

            zones = new DiggableZone[diggable.width * diggable.height];
            DiggableZone originalZone = new DiggableZone(Vector2.zero, new Vector2(diggable.width, diggable.height), diggable);

            originalZone.Update();
        }
Exemplo n.º 5
0
 public void SetZones(Vector2 coordinates, Vector2 size, DiggableZone zone)
 {
     for (int y = 0; y < size.y; y++)
     {
         for (int x = 0; x < size.x; x++)
         {
             SetZone(new Vector2(coordinates.x + x, coordinates.y + y), zone);
         }
     }
 }
Exemplo n.º 6
0
        public DiggableZone GetZone(int x, int y)
        {
            DiggableZone zone = null;

            try {
                zone = zones[y * diggable.width + x];
            }
            catch {
                Logger.LogError(string.Format("Zone at coordinates [{0}, {1}] was not found.", x, y));
            }

            return(zone);
        }
Exemplo n.º 7
0
 public void SetZones(Rect rect, DiggableZone zone)
 {
     SetZones(rect.position, rect.size, zone);
 }
Exemplo n.º 8
0
 public void SetZone(Vector2 coordinates, DiggableZone zone)
 {
     SetZone((int)coordinates.x, (int)coordinates.y, zone);
 }
Exemplo n.º 9
0
 public void SetZone(int x, int y, DiggableZone zone)
 {
     zones[y * diggable.Width + x] = zone;
 }
Exemplo n.º 10
0
 public void SetZones(Rect rect, DiggableZone zone)
 {
     SetZones(rect.position, rect.size, zone);
 }
Exemplo n.º 11
0
 public void SetZone(Vector2 coordinates, DiggableZone zone)
 {
     SetZone((int)coordinates.x, (int)coordinates.y, zone);
 }
Exemplo n.º 12
0
 public void SetZone(int x, int y, DiggableZone zone)
 {
     zones[y * diggable.width + x] = zone;
 }