Untitled

 avatar
saddam
plain_text
2 years ago
669 B
1
Indexable
Never
 void ParseandSet(string _levelOrder)
    {
        if (_levelOrder == null) return;
        if (_levelOrder == "") return;

        int outPut;
        ParseData = new int[_levelOrder.Length];
        for (int i = 0; i < _levelOrder.Length; i++)
        {

            if (int.TryParse(_levelOrder[i].ToString(), out outPut))
                ParseData[i] = outPut;
            else
                ParseData[i] = Random.Range(0, 5);
        }

        int levelLength = Levels.Length;
        for (int i = 0; i < ParseData.Length; i++)
        {
            if (i < levelLength)
                Levels[i].dificulty = ParseData[i];
        }
    }