Example #1
0
 public void Hit(TreeInteractable tree)
 {
     if (chopCooldown <= 0f)
     {
         if (OnTreeHit != null)
         {
             OnTreeHit();
         }
         chopCooldown = 1f / chopSpeed;
         this.tree    = tree;
     }
 }
    private void GetTree()
    {
        Collider[] colliders = Physics.OverlapSphere(checkerPosition, climbCheckerRadius, whatIsTree);

        currentTree = colliders[0].GetComponent <TreeInteractable>();

        if (!currentTree)
        {
            return;
        }

        if (currentTree.GetFirstPoint().y < this.playerController.transform.position.y)
        {
            currentTree = null;
        }
    }