인터랙션 가능 플로우 처리 추가

This commit is contained in:
Jeonghyeon Ha 2025-08-14 14:30:14 +09:00
parent 566a034fdd
commit eb4ea2871f
8 changed files with 85 additions and 6 deletions

View File

@ -106,6 +106,7 @@ MonoBehaviour:
_interactionType: 2 _interactionType: 2
_holdTime: 1.3 _holdTime: 1.3
_interactionMessageKey: Test _interactionMessageKey: Test
_interactionAvailableFlows: 1
--- !u!114 &3538352761187622062 --- !u!114 &3538352761187622062
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -318,3 +319,31 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f0feb22ab60a4d1885271637838f43b9, type: 3} m_Script: {fileID: 11500000, guid: f0feb22ab60a4d1885271637838f43b9, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_availableStyle:
Color: {r: 1, g: 1, b: 1, a: 1}
Width: 1
Opacity: 1
_focusedStyle:
Color: {r: 1, g: 0.92156863, b: 0.015686275, a: 1}
Width: 1
Opacity: 1
_unavailableStyle:
Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
Width: 0.5
Opacity: 1
_objectiveStyle:
Color: {r: 0, g: 1, b: 1, a: 1}
Width: 1
Opacity: 1
_breathingSpeed: 2
_breathingRange: 0.3
_enableBreathingEffect: 1
_alphaCutOff: 0.5
_combineMeshes: 1
_constantWidth: 1
_outlineQuality: 2
_outlineIndependent: 1
_outlineBlurPasses: 1
_outlineSharpness: 8
_currentOutlineType: 0
_currentOpacityMultiplier: 1

View File

@ -102,6 +102,7 @@ MonoBehaviour:
_interactionType: 1 _interactionType: 1
_holdTime: 1 _holdTime: 1
_interactionMessageKey: Test _interactionMessageKey: Test
_interactionAvailableFlows: 1
--- !u!114 &4545680930728379745 --- !u!114 &4545680930728379745
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -314,3 +315,31 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f0feb22ab60a4d1885271637838f43b9, type: 3} m_Script: {fileID: 11500000, guid: f0feb22ab60a4d1885271637838f43b9, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_availableStyle:
Color: {r: 1, g: 1, b: 1, a: 1}
Width: 1
Opacity: 1
_focusedStyle:
Color: {r: 1, g: 0.92156863, b: 0.015686275, a: 1}
Width: 1
Opacity: 1
_unavailableStyle:
Color: {r: 0.5, g: 0.5, b: 0.5, a: 1}
Width: 0.5
Opacity: 1
_objectiveStyle:
Color: {r: 0, g: 1, b: 1, a: 1}
Width: 1
Opacity: 1
_breathingSpeed: 2
_breathingRange: 0.3
_enableBreathingEffect: 1
_alphaCutOff: 0.5
_combineMeshes: 1
_constantWidth: 1
_outlineQuality: 2
_outlineIndependent: 1
_outlineBlurPasses: 1
_outlineSharpness: 8
_currentOutlineType: 0
_currentOpacityMultiplier: 1

View File

@ -16,6 +16,7 @@ public enum InteractionType : uint
public interface IInteractable public interface IInteractable
{ {
bool CanInteract(); bool CanInteract();
bool IsInteractionHidden();
bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null); bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null);
InteractionType GetInteractionType(); InteractionType GetInteractionType();
GameObject GetInteractableGameObject(); GameObject GetInteractableGameObject();

View File

@ -5,12 +5,14 @@
namespace DDD namespace DDD
{ {
public enum GameFlowState [Flags]
public enum GameFlowState : uint
{ {
None = 0, None = 0u,
ReadyForRestaurant = 1, ReadyForRestaurant = 1u,
RunRestaurant = 2, RunRestaurant = 1u << 1,
SettlementRestaurant = 3, SettlementRestaurant = 1u << 2,
All = 0xFFFFFFFFu
} }
public class GameFlowManager : Singleton<GameFlowManager>, IManager public class GameFlowManager : Singleton<GameFlowManager>, IManager

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b2288040b8e34064906af9ae303801f0
timeCreated: 1755143075

View File

@ -83,6 +83,7 @@ protected IInteractable GetNearestInteractable()
if (col.TryGetComponent<IInteractable>(out var interactable) == false) continue; if (col.TryGetComponent<IInteractable>(out var interactable) == false) continue;
var type = interactable.GetInteractionType(); var type = interactable.GetInteractionType();
if (interactable.IsInteractionHidden()) continue;
if (CanSolveInteractionType(type) == false) continue; if (CanSolveInteractionType(type) == false) continue;
float distance = Vector3.Distance(transform.position, col.transform.position); float distance = Vector3.Distance(transform.position, col.transform.position);

View File

@ -158,6 +158,11 @@ private InteractionOutlineType GetCurrentOutlineType()
if (_interactionComponent is not IInteractable interactable) if (_interactionComponent is not IInteractable interactable)
return InteractionOutlineType.None; return InteractionOutlineType.None;
if (_interactionComponent.IsInteractionHidden())
{
return InteractionOutlineType.None;
}
try try
{ {
// 상호작용 불가능한 경우 // 상호작용 불가능한 경우

View File

@ -8,9 +8,18 @@ public class RestaurantInteractionComponent : MonoBehaviour, IInteractable
[SerializeField] private float _holdTime = 1f; [SerializeField] private float _holdTime = 1f;
[SerializeField] private string _interactionMessageKey = ""; [SerializeField] private string _interactionMessageKey = "";
[SerializeField] protected GameFlowState _interactionAvailableFlows;
public bool CanInteract() public bool CanInteract()
{ {
return true; return !IsInteractionHidden();
}
public bool IsInteractionHidden()
{
var currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
var flowDisabled = (currentGameFlowState & _interactionAvailableFlows) == 0;
return flowDisabled;
} }
public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null) public bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null)