diff --git a/Assets/01_Scenes/GameScene.unity b/Assets/01_Scenes/GameScene.unity index 610d5fc..b9bed15 100644 --- a/Assets/01_Scenes/GameScene.unity +++ b/Assets/01_Scenes/GameScene.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:50a1bb266a096622511d6751e0921d713bc33588a1c4b9ef35098311ca181f1e -size 482220 +oid sha256:f5ca3709af1c5712ed2af2ce643c05b9c3e6210eaa5d9170c9892afc4b821657 +size 485001 diff --git a/Assets/02_Scripts/Interactions/IInteractable.cs b/Assets/02_Scripts/Interactions/IInteractable.cs index 0422d18..5a6fa50 100644 --- a/Assets/02_Scripts/Interactions/IInteractable.cs +++ b/Assets/02_Scripts/Interactions/IInteractable.cs @@ -5,4 +5,5 @@ public interface IInteractable public void InteractOpen(); public void InteractClose(); public void InteractExec(PlayerCharacterController player); + public void InteractEnd(PlayerCharacterController player); } diff --git a/Assets/02_Scripts/Interactions/InteractableSit.cs b/Assets/02_Scripts/Interactions/InteractableSit.cs index 3eba0ca..87ad900 100644 --- a/Assets/02_Scripts/Interactions/InteractableSit.cs +++ b/Assets/02_Scripts/Interactions/InteractableSit.cs @@ -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(); + if (_highlightEffect == null) + { + _highlightEffect = _interactionObject.AddComponent(); + } + } + + 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; + } } } diff --git a/Assets/02_Scripts/Managers/Global/GameManager.cs b/Assets/02_Scripts/Managers/Global/GameManager.cs index 4531379..10f42b4 100644 --- a/Assets/02_Scripts/Managers/Global/GameManager.cs +++ b/Assets/02_Scripts/Managers/Global/GameManager.cs @@ -1,3 +1,4 @@ +using HighlightPlus; using System; using UnityEngine; using UnityEngine.InputSystem; @@ -24,6 +25,9 @@ public class GameManager : MonoBehaviour public float ItemBounceAmplitude = 0.1f; // 오르내리는 높이 public float ItemBounceFrequency = 2f; // 오르내리는 속도 + [Header("Global Refer")] + public HighlightProfile InteractionHighlightProfile; + private void Awake() { if (Instance == null) diff --git a/Assets/02_Scripts/Managers/Local/CameraManager.cs b/Assets/02_Scripts/Managers/Local/CameraManager.cs index c4b2dbc..be00825 100644 --- a/Assets/02_Scripts/Managers/Local/CameraManager.cs +++ b/Assets/02_Scripts/Managers/Local/CameraManager.cs @@ -1,3 +1,5 @@ +using NUnit.Framework; +using System.Collections.Generic; using Unity.Cinemachine; using UnityEditor.Rendering; using UnityEngine; @@ -5,6 +7,7 @@ public class CameraManager : MonoBehaviour { + [SerializeField] private List _cameraRigList; private CameraRigBase _currentCameraRig; //현재 활성화된 플레이어의 카메라 묶음 조종객체 private float minFOV = 40f; @@ -49,7 +52,14 @@ public void OnSceneLoaded(Scene scene, LoadSceneMode mode) public void SetCameraRig(CameraRigBase cameraRig) { + foreach(CameraRigBase crb in _cameraRigList) + { + crb.Priority = 10; + } + _currentCameraRig = cameraRig; + _currentCameraRig.Priority = 15; + } public CinemachineCamera GetLiveCinemachineCamera() diff --git a/Assets/02_Scripts/Player/Camera/GeneralCameraRig.cs b/Assets/02_Scripts/Player/Camera/GeneralCameraRig.cs index 4581da3..d7517a3 100644 --- a/Assets/02_Scripts/Player/Camera/GeneralCameraRig.cs +++ b/Assets/02_Scripts/Player/Camera/GeneralCameraRig.cs @@ -16,6 +16,13 @@ public override void GetInputAxes(List axes) protected override CinemachineVirtualCameraBase ChooseCurrentCamera(Vector3 worldUp, float deltaTime) { - return (CinemachineVirtualCameraBase)LiveChild; + CinemachineVirtualCameraBase Cam; + + if (LiveChild == null) + Cam = GetHighestPriorityCamera(); + else + Cam = (CinemachineVirtualCameraBase)LiveChild; + + return Cam; } } diff --git a/Assets/02_Scripts/Player/Controllers/PlayerCharacterController.cs b/Assets/02_Scripts/Player/Controllers/PlayerCharacterController.cs index 50ab0bd..f72fb53 100644 --- a/Assets/02_Scripts/Player/Controllers/PlayerCharacterController.cs +++ b/Assets/02_Scripts/Player/Controllers/PlayerCharacterController.cs @@ -80,6 +80,7 @@ public enum PlayerRotationMode {CameraCoupled, CameraDecoupled} //상호작용 public SphereCollider InteractionCollider; public List InteractionTargets = new List(); + 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(out IInteractable interactable)) { - Debug.Log($"interactableName : {interactable}"); - - interactable.InteractOpen(); + if (InteractionTargets.Contains(interactable)) return; InteractionTargets.Add(interactable); - return; } } diff --git a/Assets/04_Shared/FX/HighlightProfiles.meta b/Assets/04_Shared/FX/HighlightProfiles.meta new file mode 100644 index 0000000..9ba0ca7 --- /dev/null +++ b/Assets/04_Shared/FX/HighlightProfiles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2748cbcb641350b4fae289694ce88c93 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Shared/FX/HighlightProfiles/InteractionHighlightProfile.asset b/Assets/04_Shared/FX/HighlightProfiles/InteractionHighlightProfile.asset new file mode 100644 index 0000000..92f91c3 --- /dev/null +++ b/Assets/04_Shared/FX/HighlightProfiles/InteractionHighlightProfile.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:100450c09067f4ed96dc79930af3a830625abb5ba345994ca112fa90de521727 +size 6464 diff --git a/Assets/04_Shared/FX/HighlightProfiles/InteractionHighlightProfile.asset.meta b/Assets/04_Shared/FX/HighlightProfiles/InteractionHighlightProfile.asset.meta new file mode 100644 index 0000000..736b728 --- /dev/null +++ b/Assets/04_Shared/FX/HighlightProfiles/InteractionHighlightProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 493987b86f2291f4d9cf4d673548d7fa +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/06_Items/FX/HighlightProfile/Highlight_FieldItem.asset b/Assets/06_Items/FX/HighlightProfile/Highlight_FieldItem.asset index bd73ba5..d565d63 100644 --- a/Assets/06_Items/FX/HighlightProfile/Highlight_FieldItem.asset +++ b/Assets/06_Items/FX/HighlightProfile/Highlight_FieldItem.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6dc6129dd60dd7a0835632c87d9817cacc8b4ae211af88a0d78d8c0ad8441f5b +oid sha256:d04f0019e177d2a18ae430939db6d90c90dd43005183f318c7a759059bb16dae size 6510 diff --git a/Assets/06_Items/Models/Consumable/LowerPotion/Prefabs/LowerPotion_Visible.prefab b/Assets/06_Items/Models/Consumable/LowerPotion/Prefabs/LowerPotion_Visible.prefab index 2932095..568d0d7 100644 --- a/Assets/06_Items/Models/Consumable/LowerPotion/Prefabs/LowerPotion_Visible.prefab +++ b/Assets/06_Items/Models/Consumable/LowerPotion/Prefabs/LowerPotion_Visible.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1a173eb07aae2dbe49f5be8484c82aea0746c780f34cbee3849dca765b0f368 +oid sha256:b49185b0fd5ba147307e538b30556778b89db1ff00eeffb9744a8ff0ddc44578 size 11102 diff --git a/Assets/06_Items/Models/Consumable/PoisonPotion/Prefabs/PoisonPotion_Visible.prefab b/Assets/06_Items/Models/Consumable/PoisonPotion/Prefabs/PoisonPotion_Visible.prefab index 854d6e9..00b6ed4 100644 --- a/Assets/06_Items/Models/Consumable/PoisonPotion/Prefabs/PoisonPotion_Visible.prefab +++ b/Assets/06_Items/Models/Consumable/PoisonPotion/Prefabs/PoisonPotion_Visible.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bde436977ef0ccddfe9dcad923a3df1fdcfa0ca8a2b9578d35f27c92837b97cc +oid sha256:158e9af93beb48939873c67f531dc52bf027c9a7a9b71d06e672a228f9e1b870 size 11099 diff --git a/Assets/09_Timelines/Timeline_Intro.playable b/Assets/09_Timelines/Timeline_Intro.playable index 355d48a..9e87b2b 100644 --- a/Assets/09_Timelines/Timeline_Intro.playable +++ b/Assets/09_Timelines/Timeline_Intro.playable @@ -74,25 +74,7 @@ MonoBehaviour: m_RotationOrder: 4 m_MixOutCurve: serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 + m_Curve: [] m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 22435d2..d9eaf92 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c723ca3b73df65da680155ba7dcfe00be894149c9095059367faff586e907a5d -size 550 +oid sha256:af0b605cdf79b0ca56de8ec16860424e92251abb5f220a1d9355ce3570113dcc +size 558