2026-04-03 인트로 타임라인, 카메라 Rig 오작동 수정, 하이라이트 투과설정 수정
해야할 것 : 버리기(dynamicObjects에 버리기),아이템 다 사용했을때 없애기
This commit is contained in:
@@ -80,6 +80,7 @@ public enum PlayerRotationMode {CameraCoupled, CameraDecoupled}
|
||||
//상호작용
|
||||
public SphereCollider InteractionCollider;
|
||||
public List<IInteractable> InteractionTargets = new List<IInteractable>();
|
||||
public IInteractable InteractionOnTarget = null;
|
||||
private bool _actionExitRequested = false;
|
||||
|
||||
//무기
|
||||
@@ -137,6 +138,8 @@ private void Update()
|
||||
WorkGravity();
|
||||
ApplyMove();
|
||||
|
||||
CheckInteraction();
|
||||
|
||||
TickTimer();
|
||||
//PlayerDebug();
|
||||
}
|
||||
@@ -456,7 +459,8 @@ public void EndAction()
|
||||
_ = Util.RunDelayed(FreezeTime, () => {
|
||||
_stateMachine.ChangeState(PlayerState.Idle);
|
||||
RotationMode = PlayerRotationMode.CameraCoupled;
|
||||
GameManager.Instance.InGameUI.InteractionVisible(true);
|
||||
InteractionOnTarget.InteractEnd(this);
|
||||
InteractionOnTarget = null;
|
||||
}, default);
|
||||
}
|
||||
#endregion
|
||||
@@ -589,8 +593,7 @@ public void InteractInput()
|
||||
|
||||
if (InteractionTargets.Count > 0)
|
||||
{
|
||||
IInteractable target = InteractionTargets[0];
|
||||
target.InteractExec(this); // 실제 상호작용 실행
|
||||
InteractionOnTarget.InteractExec(this); // 실제 상호작용 실행
|
||||
|
||||
RotationMode = PlayerRotationMode.CameraDecoupled;
|
||||
}
|
||||
@@ -651,16 +654,32 @@ private bool ActionExitCheck()
|
||||
return _actionExitRequested;
|
||||
}
|
||||
|
||||
private void CheckInteraction()
|
||||
{
|
||||
if(InteractionTargets.Count > 0)
|
||||
{
|
||||
|
||||
for(int i=0; i < InteractionTargets.Count;i++)
|
||||
{
|
||||
if(i == 0)
|
||||
{
|
||||
InteractionOnTarget = InteractionTargets[i];
|
||||
InteractionOnTarget.InteractOpen();
|
||||
}
|
||||
else
|
||||
InteractionTargets[i].InteractClose();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
// 상호작용 객체인지 확인
|
||||
if (other.TryGetComponent<IInteractable>(out IInteractable interactable))
|
||||
{
|
||||
Debug.Log($"interactableName : {interactable}");
|
||||
|
||||
interactable.InteractOpen();
|
||||
if (InteractionTargets.Contains(interactable)) return;
|
||||
InteractionTargets.Add(interactable);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user