Exemplo n.º 1
0
    public Obstacle CreateRandomObstacle()
    {
        int upperBoundary     = m_obstacles.Length;
        int lowerBoundary     = Mathf.Max(0, upperBoundary - m_numDifferentObstaclesSpawned);
        int obstacleTypeIndex = Random.Range(lowerBoundary, upperBoundary);

        Obstacle obstacleInstance = Instantiate(m_obstacles[obstacleTypeIndex]) as Obstacle;

        obstacleInstance.m_obstacleTypeIndex = obstacleTypeIndex;

        m_currentObstacleSignNumber++;
        obstacleInstance.SetObstacleSign(Rzymskie.arabic2roman(m_currentObstacleSignNumber), m_useCentralCounter);

        m_score = PlayerPrefs.GetInt("score");

        if (m_score > 0 && m_score == m_currentObstacleSignNumber)
        {
            obstacleInstance.ShowDeathMarker();
        }
        return(obstacleInstance);
    }
Exemplo n.º 2
0
 public int GetObstacleSignValue()
 {
     return(Rzymskie.roman2arabic(m_SignRightText.text));
 }