2026-04-03 인트로 타임라인, 카메라 Rig 오작동 수정, 하이라이트 투과설정 수정
해야할 것 : 버리기(dynamicObjects에 버리기),아이템 다 사용했을때 없애기
This commit is contained in:
@@ -1,13 +1,33 @@
|
||||
using HighlightPlus;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
public class InteractableSit : MonoBehaviour,IInteractable
|
||||
public class InteractableSit : MonoBehaviour, IInteractable
|
||||
{
|
||||
private bool interactionOnOff = false;
|
||||
[SerializeField] private GameObject _interactionObject;
|
||||
private HighlightProfile _highlightProfile;
|
||||
private HighlightEffect _highlightEffect;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_highlightEffect = _interactionObject.GetComponent<HighlightEffect>();
|
||||
if (_highlightEffect == null)
|
||||
{
|
||||
_highlightEffect = _interactionObject.AddComponent<HighlightEffect>();
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_highlightProfile = GameManager.Instance.InteractionHighlightProfile;
|
||||
_highlightEffect.ProfileLoad(_highlightProfile);
|
||||
_highlightEffect.highlighted = false;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if(interactionOnOff)
|
||||
if (interactionOnOff)
|
||||
{
|
||||
//메인카메라를 기준으로 좌표 변환
|
||||
Vector3 pos = Camera.main.WorldToScreenPoint(transform.position + Vector3.up * 0.5f);
|
||||
@@ -19,13 +39,19 @@ private void Update()
|
||||
|
||||
public void InteractOpen()
|
||||
{
|
||||
if (interactionOnOff == true) return;
|
||||
|
||||
interactionOnOff = true;
|
||||
ActiveEffect(true);
|
||||
GameManager.Instance.InGameUI.Interaction.OnOffSitBox(true);
|
||||
}
|
||||
|
||||
public void InteractClose()
|
||||
{
|
||||
if (interactionOnOff == false) return;
|
||||
|
||||
interactionOnOff = false;
|
||||
ActiveEffect(false);
|
||||
GameManager.Instance.InGameUI.Interaction.OnOffSitBox(false);
|
||||
}
|
||||
|
||||
@@ -33,5 +59,27 @@ public void InteractExec(PlayerCharacterController player)
|
||||
{
|
||||
player.PointSitAction(this.transform);
|
||||
GameManager.Instance.InGameUI.InteractionVisible(false);
|
||||
ActiveEffect(false);
|
||||
}
|
||||
|
||||
public void InteractEnd(PlayerCharacterController player)
|
||||
{
|
||||
GameManager.Instance.InGameUI.InteractionVisible(true);
|
||||
if (interactionOnOff)
|
||||
{
|
||||
ActiveEffect(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void ActiveEffect(bool isOn)
|
||||
{
|
||||
if(isOn)
|
||||
{
|
||||
_highlightEffect.highlighted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_highlightEffect.highlighted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user