public void NextLevel() { m_FloorIndex++; Debug.Log("Level " + m_FloorIndex); if (m_CurrentFloor != null) { m_CurrentFloor.Cleanup(); } FloorSettings floorSettings = m_Floors[Mathf.Min(m_FloorIndex, m_Floors.Length - 1)]; m_CurrentFloor = FloorInstance.PlaceFloor(m_RoomPrefab, floorSettings); SpawnPlayer(); StageNamePopup.Main.DisplayText(floorSettings.m_StageName, m_FloorIndex); }
public bool DrawFloor(int floorNum) { if (0 == floorNum) { return(false); } // for(int i=0; i<floorInstanceList.Count; i++) { // if(((FloorInstance)floorInstanceList[i]).floorNum == floorNum) { // ((FloorInstance)floorInstanceList[i]).Draw(); // return true; // } // } FloorInstance fi = FindFloorFloorInstance(floorNum); if (null == fi) { return(false); } fi.Draw(); return(true); }
public bool DelFloor(int floorNum) { if (0 == floorNum) { return(false); } // for(int i=0; i<floorInstanceList.Count; i++) { // if(((FloorInstance)floorInstanceList[i]).floorNum == floorNum) { // ((FloorInstance)floorInstanceList[i]).Destroy(); // floorInstanceList.Remove(i); // if(floorNum > 0) // upFloorNum --; // else if(floorNum < 0) // downFloorNum --; // return true; // } // } // return false; int i = 0; FloorInstance fi = FindFloorFloorInstance(floorNum, i); if (null == fi) { return(false); } fi.Destroy(); floorInstanceList.Remove(i); if (floorNum > 0) { upFloorNum--; } else if (floorNum < 0) { downFloorNum--; } floorNumChanged = true; return(true); }
public bool SetFloorHeight(int floorNum, float floorHeight) { if (0 == floorNum) { return(false); } // for(int i=0; i<floorInstanceList.Count; i++) { // if(((FloorInstance)floorInstanceList[i]).floorNum == floorNum) { // ((FloorInstance)floorInstanceList[i]).floorHeight = floorHeight; // return true; // } // } // return false; FloorInstance fi = FindFloorFloorInstance(floorNum); if (null == fi) { return(false); } fi.floorHeight = floorHeight; UpdataFloorPosition(); return(true); }
private void CreateFloor(FloorSettings floor) { m_CurrentFloor = FloorInstance.PlaceFloor(m_RoomPrefab, floor); }