public void OnTriggerStay(Collider other) { if (other.gameObject.CompareTag("Player")) { GetItem.Get(this.gameObject); } }
private void InteractionAction() { Ray ray = new Ray(transform.position, transform.forward); if (Physics.Raycast(ray, 2.0f, 1 << LayerMask.NameToLayer("Item"))) { _getItem.Get(); } else if (Physics.Raycast(ray, 2.0f, 1 << LayerMask.NameToLayer("ItemBox"))) { _getItem.OpenBox(); } else if (Physics.Raycast(ray, 2.0f, 1 << LayerMask.NameToLayer("StartPoint")) || Physics.Raycast(ray, 2.0f, 1 << LayerMask.NameToLayer("EndPoint"))) { TransferMapMng.Instance.Open(); } }