Exemple #1
0
    void inputMannager()
    {
        maxBags = potsBag.Count - 1;

        if (Input.GetKeyDown(KeyCode.E))
        {
            potsHUD.MoveNext();
            activeBag--;
            if (activeBag < 0)
            {
                activeBag = maxBags;
            }
        }
        else if (Input.GetKeyDown(KeyCode.Q))
        {
            potsHUD.MovePrev();
            activeBag++;
            if (activeBag > maxBags)
            {
                activeBag = 0;
            }
        }

        if (Input.GetMouseButton(1) && potsBag.Count > 0)
        {
            m_mousePoint.ActivateIndicator((int)potsBag[activeBag][0]);
        }
        if (Input.GetMouseButtonUp(1) && potsBag.Count > 0)
        {
            m_mousePoint.DeactivateIndicator();
            if (potsBag[activeBag].Count > 0)
            {
                Vector3 pos = GameObject.Find("ShootPoint").transform.position;

                anim.SetBool("Attacking", true);
                CraftingDataBase.ActivatePotion(potsBag[activeBag][0], pos);
                potsBag[activeBag].RemoveAt(0);
            }
        }
    }