2026-03-31 물체 상호작용

This commit is contained in:
2026-03-31 18:08:26 +09:00
parent 71dfbf1af2
commit 902b1b76fb
141 changed files with 11063 additions and 343 deletions

View File

@@ -0,0 +1,8 @@
using UnityEngine;
public interface IInteractable
{
public void InteractOpen();
public void InteractClose();
public void InteractExec(PlayerCharacterController player);
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8a75892d4d295c54e88d2933e38776c4

View File

@@ -0,0 +1,37 @@
using UnityEngine;
using UnityEngine.AI;
public class InteractableSit : MonoBehaviour,IInteractable
{
private bool interactionOnOff = false;
private void Update()
{
if(interactionOnOff)
{
//메인카메라를 기준으로 좌표 변환
Vector3 pos = Camera.main.WorldToScreenPoint(transform.position + Vector3.up * 0.5f);
//변환된 좌표로 InteractionBox 이동
GameManager.Instance.InGameUI.Interaction.UpdateSitBoxPos(pos);
}
}
public void InteractOpen()
{
interactionOnOff = true;
GameManager.Instance.InGameUI.Interaction.OnOffSitBox(true);
}
public void InteractClose()
{
interactionOnOff = false;
GameManager.Instance.InGameUI.Interaction.OnOffSitBox(false);
}
public void InteractExec(PlayerCharacterController player)
{
player.transform.position = gameObject.transform.position;
player.transform.rotation = gameObject.transform.rotation;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 36992c9e66ae1344bb485ca8bce2aa5b