private Hallway CreateHallway(HallwayPoints points) { GameObject go = new GameObject(string.Format("Hallway {0}", hallwayCount++)); go.transform.SetParent(hallwayHolder.transform); Hallway h = go.AddComponent <Hallway>(); h.Generate(points, hallwayWidth); hallways.Add(h); return(h); }
public void Generate(HallwayPoints points, int width) { this.points = points; col1 = this.gameObject.AddComponent <BoxCollider2D>(); this.width = width; //GenerateHallwayTiles(); this.transform.position = points.midPoint; }