cookui 수정 중

This commit is contained in:
NTG 2025-08-26 20:56:15 +09:00
parent 7ef27bbeae
commit d671b91e92
22 changed files with 730 additions and 83 deletions

Binary file not shown.

View File

@ -981,19 +981,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4250572641673376081, guid: f24fb953ac9ddf547b7d995610f03ca4, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4250572641673376081, guid: f24fb953ac9ddf547b7d995610f03ca4, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4250572641673376081, guid: f24fb953ac9ddf547b7d995610f03ca4, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 36.4
objectReference: {fileID: 0}
- target: {fileID: 4250572641673376081, guid: f24fb953ac9ddf547b7d995610f03ca4, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 33.2
objectReference: {fileID: 0}
- target: {fileID: 4250572641673376081, guid: f24fb953ac9ddf547b7d995610f03ca4, type: 3}
propertyPath: m_AnchoredPosition.y
@ -3243,7 +3243,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2550093527582931782, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 328.28
objectReference: {fileID: 0}
- target: {fileID: 2678955646328359672, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_IsActive
@ -3303,27 +3303,27 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5145197518110156248, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5145197518110156248, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_AnchorMin.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5145197518110156248, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 61.21
objectReference: {fileID: 0}
- target: {fileID: 5145197518110156248, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 40.69
objectReference: {fileID: 0}
- target: {fileID: 5145197518110156248, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 85.744995
objectReference: {fileID: 0}
- target: {fileID: 5145197518110156248, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
value: -4.1550007
objectReference: {fileID: 0}
- target: {fileID: 5414520022118496509, guid: 3e9030561e4db584cb648f33c4315e6b, type: 3}
propertyPath: m_AnchorMax.y
@ -5266,11 +5266,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3193108641552257316, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_AnchorMax.x
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3193108641552257316, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_AnchorMax.y
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3193108641552257316, guid: 3042958ab9668ed4aa25e965fc39b7f9, type: 3}
propertyPath: m_SizeDelta.x

Binary file not shown.

Binary file not shown.

BIN
Assets/_DDD/_Raw/Sprites/Ui/Foods/item_food_005.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: b8fee145f70373b4596fe4117078d011
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 2
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

BIN
Assets/_DDD/_Raw/Sprites/Ui/Foods/item_food_016.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: c645b09a761bd1041b026cdd4e10168c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 2
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 4091831a3196f7048927025a6dc73285
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 2
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,143 @@
fileFormatVersion: 2
guid: 53fd7887c1fe5df4abc5cad287987832
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 2
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WindowsStoreApps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.Localization.Components;
using UnityEngine.UI;
@ -72,8 +75,9 @@ protected override void SetupBindings()
{
base.SetupBindings();
BindingHelper.BindImage<CookViewModel>(_bindingContext, _cookwareImage, viewModel => viewModel.SelectedCookSnapshot.CookwareIcon);
BindingHelper.BindLocalizedStringEvent<CookViewModel>(_bindingContext, _cookwareName, viewModel => viewModel.SelectedCookSnapshot.CookwareName);
BindingHelper.BindImage(_bindingContext, _cookwareImage, nameof(_viewModel.CookwareIcon));
BindingHelper.BindLocalizedStringEvent(_bindingContext, _cookwareName, nameof(_viewModel.CookwareName));
BindingHelper.BindLocalizedStringEvent<CookViewModel>(_bindingContext, _cookName, viewModel => viewModel.SelectedCookSnapshot.Name);
BindingHelper.BindLocalizedStringEvent<CookViewModel>(_bindingContext, _cookDescriptionName, viewModel => viewModel.SelectedCookSnapshot.Description);
BindingHelper.BindText<CookViewModel>(_bindingContext, _cookPrice, viewModel => viewModel.SelectedCookSnapshot.CookPrice);
@ -82,9 +86,41 @@ protected override void SetupBindings()
protected override GameObject GetInitialSelected()
{
if (IsInitialized == false) return null;
var initialSelected = _selectedIngredients[0].gameObject;
if (initialSelected)
{
return initialSelected;
}
return null;
}
protected override bool OnInputPerformed(RestaurantUiActions actionEnum, InputAction.CallbackContext context)
{
if (base.OnInputPerformed(actionEnum, context) == false) return false;
switch (actionEnum)
{
case RestaurantUiActions.Cancel:
Close();
break;
case RestaurantUiActions.Interact1:
HandleInteract1();
break;
}
return true;
}
private void HandleInteract1()
{
var selected = EventSystem.current.currentSelectedGameObject;
var interactable = selected?.GetComponent<IInteractableUi>();
interactable?.OnInteract();
}
private void OnAddedCookTabSelected(int index)
{
_viewModel.SetAddedCook(index);
@ -94,9 +130,14 @@ private void OnAddedCookTabSelected(int index)
private void OnAddedIngredients()
{
var ingredients = _viewModel.SelectedCookSlot.Model.GetIngredients;
for (int i = 0; i < _selectedIngredients.Count; i++)
{
var ingredient = _viewModel.SelectedCookSlot.Model.GetIngredients[i];
IngredientEntry ingredient = null;
if (ingredients != null && i < ingredients.Count)
{
ingredient = ingredients[i];
}
_selectedIngredients[i].SetIngredientEntry(ingredient);
}
}

View File

@ -6,10 +6,8 @@
namespace DDD
{
public sealed class SelectedCookSnapshot
public class SelectedCookSnapshot
{
public Sprite CookwareIcon { get; }
public LocalizedString CookwareName { get; }
public LocalizedString Name { get; }
public LocalizedString Description { get; }
public Sprite CookIcon { get; }
@ -18,12 +16,10 @@ public sealed class SelectedCookSnapshot
public IReadOnlyList<TasteData> Tastes { get; }
public Material TasteMaterial { get; }
public SelectedCookSnapshot(Sprite cookwareIcon, LocalizedString cookwareName, LocalizedString name,
public SelectedCookSnapshot(LocalizedString name,
LocalizedString description, Sprite cookIcon, string cookPrice, IReadOnlyList<IngredientEntry> ingredientEntries,
IReadOnlyList<TasteData> tastes, Material tasteMaterial)
{
CookwareIcon = cookwareIcon;
CookwareName = cookwareName;
Name = name;
Description = description;
CookIcon = cookIcon;
@ -34,8 +30,6 @@ public SelectedCookSnapshot(Sprite cookwareIcon, LocalizedString cookwareName, L
}
public static readonly SelectedCookSnapshot Empty = new(
cookwareIcon: null,
cookwareName: null,
name: null,
description: null,
cookIcon: null,
@ -47,9 +41,23 @@ public SelectedCookSnapshot(Sprite cookwareIcon, LocalizedString cookwareName, L
public class CookViewModel : SimpleViewModel
{
private CookwareType _currentCookwareType;
private CookwareType _currentCookwareType = CookwareType.None;
private List<ItemSlotUi> _addedCookItemSlots;
private Sprite _cookwareIcon;
public Sprite CookwareIcon
{
get => _cookwareIcon;
set => SetField(ref _cookwareIcon, value);
}
private LocalizedString _cookwareName;
public LocalizedString CookwareName
{
get => _cookwareName;
set => SetField(ref _cookwareName, value);
}
private SelectedCookSnapshot _selectedCookSnapshot = SelectedCookSnapshot.Empty;
public SelectedCookSnapshot SelectedCookSnapshot
{
@ -74,6 +82,8 @@ public int CurrentCookIndex
public void SetCookwareType(CookwareType cookwareType)
{
_currentCookwareType = cookwareType;
var cookwareDatas = DataManager.Instance.GetDataSo<CookwareDataSo>().GetDataList();
// CookwareIcon = cookwareDatas.Find(data => data.CookwareType == cookwareType).Id;
}
public void SetAddedCook(int index)
@ -83,7 +93,7 @@ public void SetAddedCook(int index)
CurrentCookIndex = index;
BeginUpdate();
SelectedCookSlot = _addedCookItemSlots[index];
RecomputeSelectedCook();
UpdateSelectedCook();
EndUpdate();
}
@ -139,13 +149,11 @@ public TasteHashTagSlotUi CreateHashTag(Transform parent)
return Instantiate(GetRestaurantManagementData().TasteHashTagSlotUiPrefab, parent, false);
}
private void RecomputeSelectedCook()
private void UpdateSelectedCook()
{
var selectedItemModel = SelectedCookSlot.Model;
string key = selectedItemModel.GetRecipeResultKey;
var cookwareKey = selectedItemModel.GetCookwareKey;
var cookwareSprite = selectedItemModel.GetCookwareIcon;
var cookwareName = LocalizationManager.Instance.GetLocalizedName(cookwareKey);
var nameLocalizedString = LocalizationManager.Instance.GetLocalizedName(key);
var descriptionLocalizedString = LocalizationManager.Instance.GetLocalizedDescription(key);
var cookIcon = selectedItemModel.GetResultIcon;
@ -161,8 +169,6 @@ private void RecomputeSelectedCook()
};
SelectedCookSnapshot = new SelectedCookSnapshot(
cookwareIcon: cookwareSprite,
cookwareName: cookwareName,
name: nameLocalizedString,
description: descriptionLocalizedString,
cookIcon: cookIcon,

View File

@ -254,10 +254,8 @@ private void OnCategoryTabSelected(int categoryValue)
// 입력 처리 - ViewModel로 위임
protected override bool OnInputPerformed(RestaurantUiActions actionEnum, InputAction.CallbackContext context)
{
var isHandled = base.OnInputPerformed(actionEnum, context);
if (base.OnInputPerformed(actionEnum, context) == false) return false;
if (isHandled && _viewModel != null)
{
switch (actionEnum)
{
case RestaurantUiActions.Cancel:
@ -276,26 +274,22 @@ protected override bool OnInputPerformed(RestaurantUiActions actionEnum, InputAc
_viewModel.StartHold();
break;
}
}
return isHandled;
return true;
}
protected override bool OnInputCanceled(RestaurantUiActions actionEnum, InputAction.CallbackContext context)
{
var isHandled = base.OnInputCanceled(actionEnum, context);
if (base.OnInputPerformed(actionEnum, context) == false) return false;
if (isHandled && _viewModel)
{
switch (actionEnum)
{
case RestaurantUiActions.Interact2:
_viewModel.CancelHold();
break;
}
}
return isHandled;
return true;
}
}
}

View File

@ -149,9 +149,12 @@ public void OnPointerEnter(PointerEventData eventData)
EventSystem.current.SetSelectedGameObject(gameObject);
}
else if (_buttonType == ButtonType.Toggle)
{
if (_isToggled == false)
{
_isHighlighted = true;
}
}
UpdateVisualState();
}
@ -164,9 +167,12 @@ public void OnPointerExit(PointerEventData eventData)
_isSelected = false;
}
else if (_buttonType == ButtonType.Toggle)
{
if (_isToggled == false)
{
_isHighlighted = false;
}
}
UpdateVisualState();
}
@ -175,8 +181,18 @@ public void OnPointerDown(PointerEventData eventData)
if (_button.interactable == false) return;
if (eventData.button == PointerEventData.InputButton.Left)
{
if (_buttonType == ButtonType.Normal)
{
_isPressed = true;
}
else if (_buttonType == ButtonType.Toggle)
{
if (_isToggled == false)
{
_isPressed = true;
}
}
UpdateVisualState();
}
}
@ -210,9 +226,12 @@ public void OnSelect(BaseEventData eventData)
_isSelected = true;
}
else if (_buttonType == ButtonType.Toggle)
{
if (_isToggled == false)
{
_isHighlighted = true;
}
}
UpdateVisualState();
}
@ -225,9 +244,12 @@ public void OnDeselect(BaseEventData eventData)
_isSelected = false;
}
else if (_buttonType == ButtonType.Toggle)
{
if (_isToggled == false)
{
_isHighlighted = false;
}
}
UpdateVisualState();
}