Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (!allComplete)
     {
         if (!hasStarted)
         {
             if (cellsStill())
             {
                 hasStarted = true;
             }
         }
         else
         {
             if (!isFinished)
             {
                 setRooms();
                 m_delaunayController.Initialize(roomList);
                 isFinished = true;
             }
             else
             {
                 if (!DTFinished)
                 {
                     if (!m_delaunayController.IsTriangulationComplete())
                     {
                         m_delaunayController.Triangulate();
                     }
                     else
                     {
                         DTFinished = true;
                         m_mstController.Initialize(roomList, m_delaunayController.GetTriangulation());
                     }
                 }
                 else
                 {
                     if (!PrimFinished)
                     {
                         m_mstController.Update();
                         PrimFinished = true;
                         m_worldForge = new WorldForge(cellList, roomList, m_mstController);
                     }
                     else
                     {
                         m_worldForge.Create();
                         allComplete = true;
                     }
                 }
             }
         }
     }
 }