public void Construct(IMapRoomFactory mapRoomFactory, IMapDataFactory mapDataFactory, IHallwayFactory hallwayFactory, IPhysicalMapRoomFactory physMapRoomFactory, IMapRoomTools mapRoomTools, IPointTriangulation pointTriangulation) { this.mapRoomFactory = mapRoomFactory; this.mapDataFactory = mapDataFactory; this.hallwayFactory = hallwayFactory; this.physMapRoomFactory = physMapRoomFactory; this.mapRoomTools = mapRoomTools; this.pointTriangulation = pointTriangulation; }
/// <summary> /// Allows physical room objects to seperate the changes state to flag rooms as steady. /// </summary> /// <param name="roomHolder">Parent object where helper rooms are kept in scene.</param> /// <returns></returns> private IEnumerator WaitTillRoomsSeperate(IPhysicalMapRoomFactory physMapRoomTools) { float savedTimeScale = Time.timeScale; Time.timeScale = mapSettings.speedOfPhysicsSeperation; while (physMapRoomTools.RoomsHaveSeparated() == false) { yield return(new WaitForSeconds(1f)); } Time.timeScale = savedTimeScale; // Change state to move onto next step. currentState = GenerationState.RoomsSeparated; }