Example #1
0
        public Area(Vector3 center, Vector3 areaSize, Vector3 halfSize, MapGenerator map)
        {
            this.map = map;
            this.center = center;
            min = center - areaSize;
            max = center + areaSize;
            halfMin = map.PositionToIndex(center - halfSize);
            halfMax = map.PositionToIndex(center + halfSize);

            int halfMinY = halfMin.y;
            halfMin.y = halfMax.y;
            halfMax.y = halfMinY;

            cubeArea = CubePool.Instance.ActiveObject().GetComponent<CubeArea>();
        }
Example #2
0
 public Area(Vector3 center, Vector3 areaSize, Vector3 halfSize, ref CubeState[,,] mapState, MapGenerator map)
 {
     this.map = map;
     this.mapState = mapState;
     this.center = center;
     min = center - areaSize;
     max = center + areaSize;
     halfMin = map.PositionToIndex(center - halfSize);
     halfMin.y = 0;
     halfMax = map.PositionToIndex(center + halfSize);
     halfMax.y = mapState.GetLength(1);
 }