Пример #1
0
    public void ResetContent()
    {
        List <int> wishesId = Utils.GetItems(grades.Length, subjects.Length, subjects.Length);

        string    finalText = "";
        int       y         = 0;
        SpawnGift manager   = GameObject.FindGameObjectWithTag("GameManager").GetComponent <SpawnGift>();
        int       sum       = 0;

        foreach (int i in wishesId)
        {
            int mark = Random.Range(grades[i].ScoreMin, grades[i].ScoreMax);
            sum       += mark;
            finalText += "<b>" + subjects[y++] + ":</b>" + System.Environment.NewLine + grades[i].Description + " ; " + mark + " / 20" + System.Environment.NewLine + System.Environment.NewLine;
        }
        manager.IncreaseScore(((float)sum / wishesId.Count) - 10f);
        gradeList.text = finalText;
    }
Пример #2
0
    private void Start()
    {
        List <int>             wishesId  = Utils.GetItems(actions.Length, listSizeMin, listSizeMax);
        string                 finalText = "";
        SpawnGift              manager   = GameObject.FindGameObjectWithTag("GameManager").GetComponent <SpawnGift>();
        List <System.DateTime> dts       = new List <System.DateTime>();

        for (int i = 0; i < wishesId.Count; i++)
        {
            dts.Add(new System.DateTime(2018, Random.Range(1, 13), Random.Range(1, 30)));
        }
        foreach (int i in wishesId)
        {
            manager.IncreaseScore((int)actions[i].Score);
            System.DateTime dt = dts.Min();
            dts.Remove(dt);
            finalText += dt.ToString("dd/MM") + ": " + actions[i].Description + System.Environment.NewLine;
        }
        actionList.text = finalText;
    }