Ejemplo n.º 1
0
    private void MakeStation(string str)
    {
        string[] data = str.Split(',');
        for (int j = 0; j < data.Length; j++)
        {
            switch (data[j])
            {
            case "0":
                break;

            case "1":
                m_blockManager.AddBlock(j - 2, m_iStageLength);
                break;

            case "2":
                m_blockManager.AddBlock(j - 2, m_iStageLength);
                m_itemManager.AddCoin(j - 2, m_iStageLength);
                break;

            case "3":
                m_blockManager.AddBlock(j - 2, m_iStageLength);
                m_obstacleManager.AddObstacle(0, j - 2, m_iStageLength);
                break;

            case "4":
                m_blockManager.AddBlock(j - 2, m_iStageLength);
                m_obstacleManager.AddObstacle(1, j - 2, m_iStageLength);
                break;
            }
        }
        m_blockManager.AddSideBlock();
        m_iStageLength++;
    }
Ejemplo n.º 2
0
    void Start()
    {
        ObstacleManager manager = FindObjectOfType <ObstacleManager>();

        manager.AddObstacle(GetRectVertices(GetComponent <BoxCollider>()));
    }