private void Update() { if (playerNear && Input.GetMouseButton(0)) { if (canCollect && PlayerTools.GetCurrentTool() == toolType) { Debug.Log("Player is collecting resource!"); StartCoroutine(CollectResource()); } } }