인터랙션 가능 플로우 처리 추가
This commit is contained in:
parent
566a034fdd
commit
eb4ea2871f
@ -106,6 +106,7 @@ MonoBehaviour:
|
||||
_interactionType: 2
|
||||
_holdTime: 1.3
|
||||
_interactionMessageKey: Test
|
||||
_interactionAvailableFlows: 1
|
||||
--- !u!114 &3538352761187622062
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -318,3 +319,31 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f0feb22ab60a4d1885271637838f43b9, type: 3}
|
||||
m_Name:
|
||||
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
|
||||
|
@ -102,6 +102,7 @@ MonoBehaviour:
|
||||
_interactionType: 1
|
||||
_holdTime: 1
|
||||
_interactionMessageKey: Test
|
||||
_interactionAvailableFlows: 1
|
||||
--- !u!114 &4545680930728379745
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -314,3 +315,31 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f0feb22ab60a4d1885271637838f43b9, type: 3}
|
||||
m_Name:
|
||||
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
|
||||
|
@ -16,6 +16,7 @@ public enum InteractionType : uint
|
||||
public interface IInteractable
|
||||
{
|
||||
bool CanInteract();
|
||||
bool IsInteractionHidden();
|
||||
bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null);
|
||||
InteractionType GetInteractionType();
|
||||
GameObject GetInteractableGameObject();
|
||||
|
@ -5,12 +5,14 @@
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public enum GameFlowState
|
||||
[Flags]
|
||||
public enum GameFlowState : uint
|
||||
{
|
||||
None = 0,
|
||||
ReadyForRestaurant = 1,
|
||||
RunRestaurant = 2,
|
||||
SettlementRestaurant = 3,
|
||||
None = 0u,
|
||||
ReadyForRestaurant = 1u,
|
||||
RunRestaurant = 1u << 1,
|
||||
SettlementRestaurant = 1u << 2,
|
||||
All = 0xFFFFFFFFu
|
||||
}
|
||||
|
||||
public class GameFlowManager : Singleton<GameFlowManager>, IManager
|
||||
|
3
Assets/_DDD/_Scripts/GameFramework/PlayerManager.cs.meta
Normal file
3
Assets/_DDD/_Scripts/GameFramework/PlayerManager.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2288040b8e34064906af9ae303801f0
|
||||
timeCreated: 1755143075
|
@ -83,6 +83,7 @@ protected IInteractable GetNearestInteractable()
|
||||
if (col.TryGetComponent<IInteractable>(out var interactable) == false) continue;
|
||||
|
||||
var type = interactable.GetInteractionType();
|
||||
if (interactable.IsInteractionHidden()) continue;
|
||||
if (CanSolveInteractionType(type) == false) continue;
|
||||
|
||||
float distance = Vector3.Distance(transform.position, col.transform.position);
|
||||
|
@ -158,6 +158,11 @@ private InteractionOutlineType GetCurrentOutlineType()
|
||||
if (_interactionComponent is not IInteractable interactable)
|
||||
return InteractionOutlineType.None;
|
||||
|
||||
if (_interactionComponent.IsInteractionHidden())
|
||||
{
|
||||
return InteractionOutlineType.None;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// 상호작용 불가능한 경우
|
||||
|
@ -8,9 +8,18 @@ public class RestaurantInteractionComponent : MonoBehaviour, IInteractable
|
||||
[SerializeField] private float _holdTime = 1f;
|
||||
[SerializeField] private string _interactionMessageKey = "";
|
||||
|
||||
[SerializeField] protected GameFlowState _interactionAvailableFlows;
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user