Esempio n. 1
0
 bool loadRaffleByNum(int num) // (для розыгрышы из файла) парсинг строки по укзаному номеру
 {
     try {
         string[] raffleIterationsLines = getRaffleIterationsFromStringLine(raffleLines[num]);
         raffleIterations = new RaffleJSON[raffleIterationsLines.Length];
         for (int i = 0; i < raffleIterationsLines.Length; i++)
         {
             raffleIterations[i] = jsonParce(raffleIterationsLines[i]);
         }
         currentRaffleNum = 0;
         currentRaffle    = raffleIterations[currentRaffleNum];
         currentLine      = num;
     }
     catch (System.IO.IOException e) {
         Debug.Log("Exception: " + e);
         Debug.Log("StackTrace: " + e.StackTrace);
         print("Error reading from {0}. Message = {1}" + e.Message);
         print("line[" + num + "]: " + raffleLines[num]);
         return(false);
     }
     finally {
         //print("succses:" + currentRaffle.tickets.Length);
     }
     return(true);
 }
Esempio n. 2
0
    RaffleJSON jsonParce(string str)
    {
        RaffleJSON res = JsonUtility.FromJson <RaffleJSON>(str);

        return(res);
    }