Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            Debug.Log(inv.database[0].ItemsAndSize[0].ToString() + inv.database[0].ItemsAndSize[1].ToString() +
                      inv.database[0].ItemsAndSize[2].ToString() + inv.database[0].ItemsAndSize[3].ToString() +
                      inv.database[0].ItemsAndSize[4].ToString() + inv.database[0].ItemsAndSize[5].ToString() +
                      inv.database[0].ItemsAndSize[6].ToString() + inv.database[0].ItemsAndSize[7].ToString() +
                      inv.database[0].ItemsAndSize[8].ToString() + inv.database[0].ItemsAndSize[9].ToString());


            Debug.Log(inv.database[0].ItemsAmount[0].ToString() + inv.database[0].ItemsAmount[1].ToString() +
                      inv.database[0].ItemsAmount[2].ToString() + inv.database[0].ItemsAmount[3].ToString() +
                      inv.database[0].ItemsAmount[4].ToString() + inv.database[0].ItemsAmount[5].ToString() +
                      inv.database[0].ItemsAmount[6].ToString() + inv.database[0].ItemsAmount[7].ToString() +
                      inv.database[0].ItemsAmount[8].ToString() + inv.database[0].ItemsAmount[9].ToString());
        }
        if (Input.GetKeyDown(KeyCode.B))
        {
            inv.AddItemtoInventoryByTitle("main_inv", "Energy Bar", inv.invOpen_main_inv);
        }
        counterText.text = hours.ToString("00") + ":" + minutes.ToString("00");
        if (minutes >= 60)
        {
            StopCoroutine("timeMinutes");
            hours += 1;
            gameObject.SendMessage("CheckingHour", null);
            minutes = 0;
            StartCoroutine("timeMinutes");
        }
        if (hours >= 24)
        {
            hours = 0;
        }
    }