コード例 #1
0
    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);
    }
コード例 #2
0
    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);
    }
コード例 #3
0
    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);
    }
コード例 #4
0
    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);
    }
コード例 #5
0
 private void CreateFloor(FloorSettings floor)
 {
     m_CurrentFloor = FloorInstance.PlaceFloor(m_RoomPrefab, floor);
 }