Ejemplo n.º 1
0
    void OnTriggerStay(Collider other)

    {
        if (Input.GetKeyDown(KeyCode.P) && (other.tag == "Collect_gold" || other.tag == "Collect_wood" || other.tag == "Collect_stone"))
        {
            Collectable script = (Collectable)other.GetComponent(typeof(Collectable));
            script.PickRessources();
            if (script.getIsEmpty())
            {
                dispSys.OpenMessagePanel("-No more ressources-");
            }
            else
            {
                dispSys.CloseMessagePanel();
                dispSys.OpenMessagePanel("-Press P to gather-");
            }
        }
        else if (Input.GetKeyDown(KeyCode.M) && (other.tag == "village"))
        {
            dispSys.CloseMessagePanel();
            OnManageMode(true);
        }
    }