interactionData 추가

This commit is contained in:
NTG 2025-08-28 18:11:13 +09:00
parent 86c0f67c7c
commit 1b45975502
9 changed files with 79 additions and 12 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
namespace DDD
{
@ -28,11 +29,12 @@ public InteractionExecutionParameters(float holdTime = 0f)
[System.Serializable]
public struct InteractionDisplayParameters
{
[SerializeField] private string _messageKey;
public string MessageKey => _messageKey;
public InteractionDisplayParameters(string messageKey = "")
[field: SerializeField] public string SuccessMessageKey { get; private set; }
[field: SerializeField] public string FailureMessageKey { get; private set; }
public InteractionDisplayParameters(string successMessageKey = "", string failureMessageKey = "")
{
_messageKey = messageKey;
SuccessMessageKey = successMessageKey;
FailureMessageKey = failureMessageKey;
}
}

View File

@ -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;
}
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a2a6159df6eba7442846f45c30f98c4f

View File

@ -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;
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 91a858d70636bb9418edbee22449d147

View File

@ -154,7 +154,7 @@ private void BroadcastShowUi(IInteractable interactable, bool canInteract, float
{
var evt = GameEvents.ShowInteractionUiEvent;
evt.CanInteract = canInteract;
evt.TextKey = interactable.GetDisplayParameters().MessageKey;
evt.TextKey = interactable.GetDisplayParameters().SuccessMessageKey;
evt.HoldProgress = ratio;
EventBus.Broadcast(evt);
}

View File

@ -6,13 +6,13 @@ namespace DDD
[Flags]
public enum RestaurantManagementType : uint
{
OpenRestaurantMenu = 0,
StartRestaurant = 1,
OpenManagementUi = 0,
RunRestaurant = 1,
}
public class InteractionSubsystem_Management : MonoBehaviour, IInteractionSubsystemObject<RestaurantManagementType>
{
[SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenRestaurantMenu;
[SerializeField] protected RestaurantManagementType _managementType = RestaurantManagementType.OpenManagementUi;
public RestaurantManagementType GetInteractionSubsystemType()
{

View File

@ -11,8 +11,9 @@ public static class RestaurantInteractionSubsystems
{
public static Dictionary<InteractionType, Type> TypeToSubsystem = new()
{
{InteractionType.RestaurantOrder, typeof(InteractionSubsystem_Order)},
{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;
InitializeSubsystems();
}
private void InitializeSubsystems()
@ -133,6 +135,11 @@ public virtual InteractionExecutionParameters GetExecutionParameters()
return _executionParameters;
}
private void SetDisplayParameters()
{
}
public virtual InteractionDisplayParameters GetDisplayParameters()
{
return _displayParameters;
@ -146,7 +153,7 @@ public float GetRequiredHoldTime()
public string GetInteractionMessageKey()
{
return _displayParameters.MessageKey;
return _displayParameters.SuccessMessageKey;
}
public Vector3[] GetInteractionPoints()

View File

@ -8,8 +8,8 @@ public class RestaurantManagementSolver : RestaurantSubsystemSolver<RestaurantMa
private Dictionary<RestaurantManagementType, Type> _typeToManagementSolver = new()
{
{ RestaurantManagementType.OpenRestaurantMenu, typeof(RestaurantManagementSolver_Menu) },
{ RestaurantManagementType.StartRestaurant, typeof(RestaurantManagementSolver_Start) },
{ RestaurantManagementType.OpenManagementUi, typeof(RestaurantManagementSolver_Menu) },
{ RestaurantManagementType.RunRestaurant, typeof(RestaurantManagementSolver_Start) },
};
protected override Dictionary<RestaurantManagementType, Type> GetSubsystemSolverTypeMappings()
{