요리도구 ui와 상호작용
This commit is contained in:
parent
05ab2c0b89
commit
e5ebb71832
@ -348,6 +348,9 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 4895648053684561955}
|
||||
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 1633775615311007542}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
--- !u!1 &1277704713268947483 stripped
|
||||
GameObject:
|
||||
@ -627,6 +630,19 @@ MonoBehaviour:
|
||||
_outlineSharpness: 8
|
||||
_currentOutlineType: 0
|
||||
_currentOpacityMultiplier: 1
|
||||
--- !u!114 &1633775615311007542
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1277704713268947483}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 51968825b07cc964fafbc62c69322b30, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
<CookwareType>k__BackingField: 3
|
||||
--- !u!4 &3654677467368248574 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2204914584875671904, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
|
@ -229,6 +229,9 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 6199984767033459821}
|
||||
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 8977540742820762731}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
--- !u!1 &4244061870577629946 stripped
|
||||
GameObject:
|
||||
@ -508,6 +511,19 @@ MonoBehaviour:
|
||||
_outlineSharpness: 8
|
||||
_currentOutlineType: 0
|
||||
_currentOpacityMultiplier: 1
|
||||
--- !u!114 &8977540742820762731
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4244061870577629946}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 51968825b07cc964fafbc62c69322b30, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
<CookwareType>k__BackingField: 2
|
||||
--- !u!4 &4499382904539758566 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4111453722694982297, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
|
@ -265,6 +265,9 @@ PrefabInstance:
|
||||
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 4049645275774486586}
|
||||
- targetCorrespondingSourceObject: {fileID: 4438924429928472453, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 216072919608443244}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 1d634c3376e4a4684bc984ced9134847, type: 3}
|
||||
--- !u!4 &8675645304246391653 stripped
|
||||
Transform:
|
||||
@ -549,6 +552,19 @@ MonoBehaviour:
|
||||
_outlineSharpness: 8
|
||||
_currentOutlineType: 0
|
||||
_currentOpacityMultiplier: 1
|
||||
--- !u!114 &216072919608443244
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9003538228676253305}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 51968825b07cc964fafbc62c69322b30, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
<CookwareType>k__BackingField: 1
|
||||
--- !u!1001 &5406243702551518767
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -426,7 +426,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 81e01dd8c1cc3404d805400eba1bb4ae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_availableInteractions: 5
|
||||
_availableInteractions: 13
|
||||
_nearColliders:
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 759cab89a413f3e4cb8a9ae2afc2e48a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DDD.Restaurant
|
||||
{
|
||||
public interface ICookware
|
||||
{
|
||||
CookwareType CookwareType { get; }
|
||||
}
|
||||
|
||||
public class CookwareComponent : MonoBehaviour, ICookware
|
||||
{
|
||||
[field: SerializeField] public CookwareType CookwareType { get; private set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51968825b07cc964fafbc62c69322b30
|
@ -37,10 +37,5 @@ public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloa
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public ScriptableObject GetPayload()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,8 @@ public static class RestaurantInteractionSubsystems
|
||||
{
|
||||
{InteractionType.RestaurantOrder, typeof(InteractionSubsystem_Order)},
|
||||
{InteractionType.RestaurantManagement, typeof(InteractionSubsystem_Management)},
|
||||
{InteractionType.RestaurantMeal, typeof(InteractionSubsystem_Meal)}
|
||||
{InteractionType.RestaurantMeal, typeof(InteractionSubsystem_Meal)},
|
||||
{InteractionType.RestaurantCook, typeof(InteractionSubsystem_Cook)},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -4,19 +4,37 @@ namespace DDD.Restaurant
|
||||
{
|
||||
public class RestaurantCookSolver_OpenCookUi : MonoBehaviour, IInteractionSubsystemSolver<RestaurantCookType>
|
||||
{
|
||||
private CookwareType _cookwareType;
|
||||
|
||||
public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payload = null)
|
||||
{
|
||||
if (CanExecuteInteractionSubsystem(interactor, interactable, payload) == false) return false;
|
||||
|
||||
var evt = GameEvents.OpenPopupUiEvent;
|
||||
evt.UiType = typeof(CookUi);
|
||||
//evt.Payload = cookwareTypePayload.CookwareType;
|
||||
evt.Payload = _cookwareType;
|
||||
EventBus.Broadcast(evt);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payload = null)
|
||||
{
|
||||
_cookwareType = CookwareType.None;
|
||||
var iCookware = interactable?.GetInteractableGameObject().GetComponent<ICookware>();
|
||||
if (iCookware == null) return false;
|
||||
|
||||
var interactableCookwareType = iCookware.CookwareType;
|
||||
if (DataManager.Instance.GetDataSo<CookwareDataSo>().TryGetValueByCookwareType(interactableCookwareType, out var cookwareData) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (RestaurantState.Instance.ManagementState.HasAddedCookByCookwareKey(cookwareData.Id) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_cookwareType = interactableCookwareType;
|
||||
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
|
||||
return currentGameFlowState == GameFlowState.RunRestaurant;
|
||||
}
|
||||
|
@ -254,5 +254,10 @@ public bool IsTodayMenuMatched(string cookwareId)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasAddedCookByCookwareKey(string cookwareKey)
|
||||
{
|
||||
return _cookwareToRecipeIds.ContainsKey(cookwareKey) && _cookwareToRecipeIds[cookwareKey].Count > 0;;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user