interactionData 추가
This commit is contained in:
parent
86c0f67c7c
commit
1b45975502
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
@ -28,11 +29,12 @@ public InteractionExecutionParameters(float holdTime = 0f)
|
|||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public struct InteractionDisplayParameters
|
public struct InteractionDisplayParameters
|
||||||
{
|
{
|
||||||
[SerializeField] private string _messageKey;
|
[field: SerializeField] public string SuccessMessageKey { get; private set; }
|
||||||
public string MessageKey => _messageKey;
|
[field: SerializeField] public string FailureMessageKey { get; private set; }
|
||||||
public InteractionDisplayParameters(string messageKey = "")
|
public InteractionDisplayParameters(string successMessageKey = "", string failureMessageKey = "")
|
||||||
{
|
{
|
||||||
_messageKey = messageKey;
|
SuccessMessageKey = successMessageKey;
|
||||||
|
FailureMessageKey = failureMessageKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
// <auto-generated> File: CookwareDataAsset.cs
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "InteractionDataAsset", menuName = "GoogleSheet/InteractionDataAsset")]
|
||||||
|
public class InteractionDataAsset : DataAsset<InteractionDataEntry>
|
||||||
|
{
|
||||||
|
public void InteractionTypeParsing(string unparsedInteractionType)
|
||||||
|
{
|
||||||
|
var split = unparsedInteractionType.Split('.');
|
||||||
|
var interactionType = split[0];
|
||||||
|
var interactionSubsystemType = split[1];
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(interactionType) || string.IsNullOrWhiteSpace(interactionSubsystemType))
|
||||||
|
{
|
||||||
|
Debug.LogError($"{unparsedInteractionType} 파싱 오류");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a2a6159df6eba7442846f45c30f98c4f
|
@ -0,0 +1,30 @@
|
|||||||
|
// <auto-generated>
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class InteractionDataEntry : IId
|
||||||
|
{
|
||||||
|
/// <summary>식별ID</summary>
|
||||||
|
[Tooltip("식별ID")]
|
||||||
|
[field: SerializeField]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>파싱 전 타입</summary>
|
||||||
|
[Tooltip("파싱 전 타입")]
|
||||||
|
[field: SerializeField]
|
||||||
|
public string UnparsedInteractionType;
|
||||||
|
|
||||||
|
/// <summary>상호작용 성공 현지화 키 값</summary>
|
||||||
|
[Tooltip("상호작용 성공 현지화 키 값")]
|
||||||
|
[field: SerializeField]
|
||||||
|
public string SuccessMessageKey;
|
||||||
|
|
||||||
|
/// <summary>상호작용 실패 현지화 키 값</summary>
|
||||||
|
[Tooltip("상호작용 실패 현지화 키 값")]
|
||||||
|
[field: SerializeField]
|
||||||
|
public string FailureMessageKey;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 91a858d70636bb9418edbee22449d147
|
@ -154,7 +154,7 @@ private void BroadcastShowUi(IInteractable interactable, bool canInteract, float
|
|||||||
{
|
{
|
||||||
var evt = GameEvents.ShowInteractionUiEvent;
|
var evt = GameEvents.ShowInteractionUiEvent;
|
||||||
evt.CanInteract = canInteract;
|
evt.CanInteract = canInteract;
|
||||||
evt.TextKey = interactable.GetDisplayParameters().MessageKey;
|
evt.TextKey = interactable.GetDisplayParameters().SuccessMessageKey;
|
||||||
evt.HoldProgress = ratio;
|
evt.HoldProgress = ratio;
|
||||||
EventBus.Broadcast(evt);
|
EventBus.Broadcast(evt);
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,13 @@ namespace DDD
|
|||||||
[Flags]
|
[Flags]
|
||||||
public enum RestaurantManagementType : uint
|
public enum RestaurantManagementType : uint
|
||||||
{
|
{
|
||||||
OpenRestaurantMenu = 0,
|
OpenManagementUi = 0,
|
||||||
StartRestaurant = 1,
|
RunRestaurant = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InteractionSubsystem_Management : MonoBehaviour, IInteractionSubsystemObject<RestaurantManagementType>
|
public class InteractionSubsystem_Management : MonoBehaviour, IInteractionSubsystemObject<RestaurantManagementType>
|
||||||
{
|
{
|
||||||
[SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenRestaurantMenu;
|
[SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenManagementUi;
|
||||||
|
|
||||||
public RestaurantManagementType GetInteractionSubsystemType()
|
public RestaurantManagementType GetInteractionSubsystemType()
|
||||||
{
|
{
|
||||||
|
@ -11,8 +11,9 @@ public static class RestaurantInteractionSubsystems
|
|||||||
{
|
{
|
||||||
public static Dictionary<InteractionType, Type> TypeToSubsystem = new()
|
public static Dictionary<InteractionType, Type> TypeToSubsystem = new()
|
||||||
{
|
{
|
||||||
{InteractionType.RestaurantOrder, typeof(InteractionSubsystem_Order)},
|
|
||||||
{InteractionType.RestaurantManagement, typeof(InteractionSubsystem_Management)},
|
{InteractionType.RestaurantManagement, typeof(InteractionSubsystem_Management)},
|
||||||
|
{InteractionType.RestaurantOrder, typeof(InteractionSubsystem_Order)},
|
||||||
|
{InteractionType.RestaurantCook, typeof(InteractionSubsystem_Cook)},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +96,7 @@ public virtual void InitializeInteraction(InteractionType interactionType)
|
|||||||
_isInitialized = true;
|
_isInitialized = true;
|
||||||
|
|
||||||
InitializeSubsystems();
|
InitializeSubsystems();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeSubsystems()
|
private void InitializeSubsystems()
|
||||||
@ -133,6 +135,11 @@ public virtual InteractionExecutionParameters GetExecutionParameters()
|
|||||||
return _executionParameters;
|
return _executionParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetDisplayParameters()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public virtual InteractionDisplayParameters GetDisplayParameters()
|
public virtual InteractionDisplayParameters GetDisplayParameters()
|
||||||
{
|
{
|
||||||
return _displayParameters;
|
return _displayParameters;
|
||||||
@ -146,7 +153,7 @@ public float GetRequiredHoldTime()
|
|||||||
|
|
||||||
public string GetInteractionMessageKey()
|
public string GetInteractionMessageKey()
|
||||||
{
|
{
|
||||||
return _displayParameters.MessageKey;
|
return _displayParameters.SuccessMessageKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3[] GetInteractionPoints()
|
public Vector3[] GetInteractionPoints()
|
||||||
|
@ -8,8 +8,8 @@ public class RestaurantManagementSolver : RestaurantSubsystemSolver<RestaurantMa
|
|||||||
|
|
||||||
private Dictionary<RestaurantManagementType, Type> _typeToManagementSolver = new()
|
private Dictionary<RestaurantManagementType, Type> _typeToManagementSolver = new()
|
||||||
{
|
{
|
||||||
{ RestaurantManagementType.OpenRestaurantMenu, typeof(RestaurantManagementSolver_Menu) },
|
{ RestaurantManagementType.OpenManagementUi, typeof(RestaurantManagementSolver_Menu) },
|
||||||
{ RestaurantManagementType.StartRestaurant, typeof(RestaurantManagementSolver_Start) },
|
{ RestaurantManagementType.RunRestaurant, typeof(RestaurantManagementSolver_Start) },
|
||||||
};
|
};
|
||||||
protected override Dictionary<RestaurantManagementType, Type> GetSubsystemSolverTypeMappings()
|
protected override Dictionary<RestaurantManagementType, Type> GetSubsystemSolverTypeMappings()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user