Ejemplo n.º 1
0
 public void CollectSugar()
 {
     if (readToCollect)
     {
         _nutrientManager.AddSugar(treeSugarValue);
         _collectableManager.AddCollectable(transform.position, treeSugarValue);
         FindObjectOfType <AudioManager>().Play("Chime");
         treeSugarValue = 0;
         readToCollect  = false;
     }
 }
Ejemplo n.º 2
0
    private void RayCastInput()
    {
        Ray        inputRay = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(inputRay, out hit))
        {
            {
                if (hit.collider.name.Equals("FungiObject-Menu"))
                {
                    growing = true;
                }

                if (hit.collider.name.Equals("TreeObject-MainMenu-02"))
                {
                    tree.GetComponent <Outline>().enabled = false;
                    _collectableManager.AddCollectable(hit.collider.transform.position, 5);
                }
            }
        }
    }