조리 도구 탭 작업 중
This commit is contained in:
parent
cbc1d6982d
commit
6d08ec9252
@ -12,7 +12,8 @@ SpriteAtlasAsset:
|
|||||||
m_ImporterData:
|
m_ImporterData:
|
||||||
packables:
|
packables:
|
||||||
- {fileID: -502432213, guid: f6859731666dd444a9c3bc04005ac3fa, type: 3}
|
- {fileID: -502432213, guid: f6859731666dd444a9c3bc04005ac3fa, type: 3}
|
||||||
- {fileID: -975732387, guid: 0b80400f6a609d6489f9da53bc2438c7, type: 3}
|
- {fileID: 141783083, guid: acadfd472bff2194fb213497cdc62d66, type: 3}
|
||||||
- {fileID: 825273812, guid: bcb8eb887f2d0814d9faa440dd50bce4, type: 3}
|
- {fileID: 825273812, guid: bcb8eb887f2d0814d9faa440dd50bce4, type: 3}
|
||||||
|
- {fileID: -975732387, guid: 0b80400f6a609d6489f9da53bc2438c7, type: 3}
|
||||||
m_IsVariant: 0
|
m_IsVariant: 0
|
||||||
m_ScriptablePacker: {fileID: 0}
|
m_ScriptablePacker: {fileID: 0}
|
||||||
|
BIN
Assets/_DDD/_Raw/OnlyAtlas/RestaurantManagementUi/CookwareDetailPanel.png
(Stored with Git LFS)
Normal file
BIN
Assets/_DDD/_Raw/OnlyAtlas/RestaurantManagementUi/CookwareDetailPanel.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,168 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: acadfd472bff2194fb213497cdc62d66
|
||||||
|
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: 2
|
||||||
|
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: 1
|
||||||
|
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:
|
||||||
|
- serializedVersion: 2
|
||||||
|
name: CookwareDetailPanel
|
||||||
|
rect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 117
|
||||||
|
width: 512
|
||||||
|
height: 234
|
||||||
|
alignment: 0
|
||||||
|
pivot: {x: 0.5, y: 0.5}
|
||||||
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
customData:
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
tessellationDetail: 0
|
||||||
|
bones: []
|
||||||
|
spriteID: 70a27c0e626941b4ba70d935160ae374
|
||||||
|
internalID: 141783083
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
outline: []
|
||||||
|
customData:
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spriteCustomMetadata:
|
||||||
|
entries:
|
||||||
|
- key: SpriteEditor.SliceSettings
|
||||||
|
value: '{"sliceOnImport":false,"gridCellCount":{"x":1.0,"y":1.0},"gridSpriteSize":{"x":64.0,"y":64.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"slicingType":0,"keepEmptyRects":false,"isAlternate":false}'
|
||||||
|
nameFileIdTable:
|
||||||
|
CookwareDetailPanel: 141783083
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -123,7 +123,7 @@ TextureImporter:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites:
|
sprites:
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
name: NotCookwarePanel
|
name: IngredientDetailPanel
|
||||||
rect:
|
rect:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
@ -160,7 +160,7 @@ TextureImporter:
|
|||||||
- key: SpriteEditor.SliceSettings
|
- key: SpriteEditor.SliceSettings
|
||||||
value: '{"sliceOnImport":false,"gridCellCount":{"x":1.0,"y":1.0},"gridSpriteSize":{"x":64.0,"y":64.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"slicingType":0,"keepEmptyRects":false,"isAlternate":false}'
|
value: '{"sliceOnImport":false,"gridCellCount":{"x":1.0,"y":1.0},"gridSpriteSize":{"x":64.0,"y":64.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"slicingType":0,"keepEmptyRects":false,"isAlternate":false}'
|
||||||
nameFileIdTable:
|
nameFileIdTable:
|
||||||
NotCookwarePanel: 825273812
|
IngredientDetailPanel: 825273812
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData: processed
|
userData: processed
|
@ -136,7 +136,7 @@ TextureImporter:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites:
|
sprites:
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
name: CookwarePanel
|
name: RecipeDetailPanel
|
||||||
rect:
|
rect:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
@ -173,7 +173,7 @@ TextureImporter:
|
|||||||
- key: SpriteEditor.SliceSettings
|
- key: SpriteEditor.SliceSettings
|
||||||
value: '{"sliceOnImport":false,"gridCellCount":{"x":1.0,"y":1.0},"gridSpriteSize":{"x":64.0,"y":64.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"slicingType":0,"keepEmptyRects":false,"isAlternate":false}'
|
value: '{"sliceOnImport":false,"gridCellCount":{"x":1.0,"y":1.0},"gridSpriteSize":{"x":64.0,"y":64.0},"gridSpriteOffset":{"x":0.0,"y":0.0},"gridSpritePadding":{"x":0.0,"y":0.0},"pivot":{"x":0.0,"y":0.0},"autoSlicingMethod":0,"spriteAlignment":0,"slicingType":0,"keepEmptyRects":false,"isAlternate":false}'
|
||||||
nameFileIdTable:
|
nameFileIdTable:
|
||||||
CookwarePanel: -975732387
|
RecipeDetailPanel: -975732387
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData: processed
|
userData: processed
|
File diff suppressed because it is too large
Load Diff
@ -100,9 +100,9 @@ private bool MatchesCategory(ItemViewModel model, InventoryCategoryType category
|
|||||||
case InventoryCategoryType.Ingredient:
|
case InventoryCategoryType.Ingredient:
|
||||||
return model.ItemType == ItemType.Ingredient;
|
return model.ItemType == ItemType.Ingredient;
|
||||||
case InventoryCategoryType.Cookware:
|
case InventoryCategoryType.Cookware:
|
||||||
|
return DataManager.Instance.GetDataSo<CookwareDataSo>().TryGetDataById(model.Id, out var cookwareData);
|
||||||
case InventoryCategoryType.Special:
|
case InventoryCategoryType.Special:
|
||||||
return true;
|
return false;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ public class ItemDetailView : MonoBehaviour, IEventHandler<ItemSlotSelectedEvent
|
|||||||
[SerializeField] private LocalizeStringEvent _descriptionLocalizer;
|
[SerializeField] private LocalizeStringEvent _descriptionLocalizer;
|
||||||
[SerializeField] private Transform _cookWarePanel;
|
[SerializeField] private Transform _cookWarePanel;
|
||||||
[SerializeField] private Image _cookwareImage;
|
[SerializeField] private Image _cookwareImage;
|
||||||
|
[SerializeField] private Transform _tasteHashTagPanel;
|
||||||
[SerializeField] private RectTransform _tasteHashTagContent1;
|
[SerializeField] private RectTransform _tasteHashTagContent1;
|
||||||
[SerializeField] private HorizontalLayoutGroup _tasteHashTagContentLayoutGroup;
|
[SerializeField] private HorizontalLayoutGroup _tasteHashTagContentLayoutGroup;
|
||||||
[SerializeField] private RectTransform _tasteHashTagContent2;
|
[SerializeField] private RectTransform _tasteHashTagContent2;
|
||||||
@ -27,8 +28,9 @@ public class ItemDetailView : MonoBehaviour, IEventHandler<ItemSlotSelectedEvent
|
|||||||
private ItemViewModel _currentItemViewModel;
|
private ItemViewModel _currentItemViewModel;
|
||||||
private TaskCompletionSource<bool> _isInitialized = new();
|
private TaskCompletionSource<bool> _isInitialized = new();
|
||||||
|
|
||||||
private const string CookwarePanel = "CookwarePanel";
|
private const string CookwareDetailPanel = "CookwareDetailPanel";
|
||||||
private const string NotCookwarePanel = "NotCookwarePanel";
|
private const string IngredientDetailPanel = "IngredientDetailPanel";
|
||||||
|
private const string RecipeDetailPanel = "RecipeDetailPanel";
|
||||||
|
|
||||||
private async void Start()
|
private async void Start()
|
||||||
{
|
{
|
||||||
@ -129,17 +131,31 @@ private void UpdateTasteHashTags(ItemViewModel model)
|
|||||||
|
|
||||||
public void UpdateCategory(InventoryCategoryType category)
|
public void UpdateCategory(InventoryCategoryType category)
|
||||||
{
|
{
|
||||||
if (category == InventoryCategoryType.Ingredient)
|
switch (category)
|
||||||
{
|
{
|
||||||
_viewImage.sprite = DataManager.Instance.GetSprite(NotCookwarePanel);
|
case InventoryCategoryType.Food:
|
||||||
_cookWarePanel.gameObject.SetActive(false);
|
case InventoryCategoryType.Drink:
|
||||||
}
|
_viewImage.sprite = DataManager.Instance.GetSprite(RecipeDetailPanel);
|
||||||
else
|
_tasteHashTagPanel.gameObject.SetActive(true);
|
||||||
{
|
|
||||||
_viewImage.sprite = DataManager.Instance.GetSprite(CookwarePanel);
|
|
||||||
_cookWarePanel.gameObject.SetActive(true);
|
_cookWarePanel.gameObject.SetActive(true);
|
||||||
|
break;
|
||||||
|
case InventoryCategoryType.Ingredient:
|
||||||
|
_viewImage.sprite = DataManager.Instance.GetSprite(IngredientDetailPanel);
|
||||||
|
_tasteHashTagPanel.gameObject.SetActive(true);
|
||||||
|
_cookWarePanel.gameObject.SetActive(false);
|
||||||
|
break;
|
||||||
|
case InventoryCategoryType.Cookware:
|
||||||
|
case InventoryCategoryType.Special:
|
||||||
|
_viewImage.sprite = DataManager.Instance.GetSprite(CookwareDetailPanel);
|
||||||
|
_tasteHashTagPanel.gameObject.SetActive(false);
|
||||||
|
_cookWarePanel.gameObject.SetActive(false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(category), category, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_tasteHashTagPanel.gameObject.activeInHierarchy) return;
|
||||||
|
|
||||||
Canvas.ForceUpdateCanvases();
|
Canvas.ForceUpdateCanvases();
|
||||||
UpdateTasteHashTags(_currentItemViewModel);
|
UpdateTasteHashTags(_currentItemViewModel);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.InputSystem;
|
using UnityEngine.InputSystem;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
{
|
{
|
||||||
@ -10,14 +11,15 @@ public class RestaurantManagementUi : PopupUi<RestaurantUiActions>, IEventHandle
|
|||||||
[SerializeField] private InventoryView _inventoryView;
|
[SerializeField] private InventoryView _inventoryView;
|
||||||
[SerializeField] private ItemDetailView _itemDetailView;
|
[SerializeField] private ItemDetailView _itemDetailView;
|
||||||
[SerializeField] private TabGroupUi<RestaurantManagementSectionType> _sectionTabs;
|
[SerializeField] private TabGroupUi<RestaurantManagementSectionType> _sectionTabs;
|
||||||
[SerializeField] private TabGroupUi<InventoryCategoryType> _categoryTabs;
|
[SerializeField] private TabGroupUi<InventoryCategoryType> _menuCategoryTabs;
|
||||||
|
[SerializeField] private TabGroupUi<InventoryCategoryType> _cookwareCategoryTabs;
|
||||||
|
|
||||||
protected override GameObject GetInitialSelected()
|
protected override GameObject GetInitialSelected()
|
||||||
{
|
{
|
||||||
var inventoryViewInitialSelectedObject = _inventoryView.GetInitialSelected();
|
var inventoryViewInitialSelectedObject = _inventoryView.GetInitialSelected();
|
||||||
if (inventoryViewInitialSelectedObject) return inventoryViewInitialSelectedObject;
|
if (inventoryViewInitialSelectedObject) return inventoryViewInitialSelectedObject;
|
||||||
|
|
||||||
return _categoryTabs.GetFirstInteractableButton;
|
return _menuCategoryTabs.GetFirstInteractableButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async override void Open()
|
public async override void Open()
|
||||||
@ -26,7 +28,11 @@ public async override void Open()
|
|||||||
|
|
||||||
await _inventoryView.Initialize();
|
await _inventoryView.Initialize();
|
||||||
_sectionTabs.Initialize(OnSectionTabSelected);
|
_sectionTabs.Initialize(OnSectionTabSelected);
|
||||||
_categoryTabs.Initialize(OnCategoryTabSelected);
|
_menuCategoryTabs.Initialize(OnCategoryTabSelected);
|
||||||
|
_cookwareCategoryTabs.Initialize(OnCategoryTabSelected);
|
||||||
|
|
||||||
|
_sectionTabs.SelectFirstTab();
|
||||||
|
_menuCategoryTabs.SelectFirstTab();
|
||||||
EventBus.Register<TodayMenuRemovedEvent>(this);
|
EventBus.Register<TodayMenuRemovedEvent>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +93,17 @@ private void HandleInteract2()
|
|||||||
|
|
||||||
private void OnSectionTabSelected(RestaurantManagementSectionType section)
|
private void OnSectionTabSelected(RestaurantManagementSectionType section)
|
||||||
{
|
{
|
||||||
|
switch (section)
|
||||||
|
{
|
||||||
|
case RestaurantManagementSectionType.Menu:
|
||||||
|
_menuCategoryTabs.SelectFirstTab();
|
||||||
|
break;
|
||||||
|
case RestaurantManagementSectionType.Cookware:
|
||||||
|
_cookwareCategoryTabs.SelectFirstTab();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(section), section, null);
|
||||||
|
}
|
||||||
// TODO : 추후 Menu, Cookware, Worker에 맞춰 다른 콘텐츠 노출 처리
|
// TODO : 추후 Menu, Cookware, Worker에 맞춰 다른 콘텐츠 노출 처리
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +124,7 @@ public void Invoke(TodayMenuRemovedEvent evt)
|
|||||||
|
|
||||||
if (newInventoryCategoryType == InventoryCategoryType.None) return;
|
if (newInventoryCategoryType == InventoryCategoryType.None) return;
|
||||||
|
|
||||||
_categoryTabs.SelectTab(newInventoryCategoryType);
|
_menuCategoryTabs.SelectTab(newInventoryCategoryType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
namespace DDD
|
namespace DDD
|
||||||
@ -32,11 +33,21 @@ public class TabButtonUi<T> : MonoBehaviour, IInteractableUi where T : Enum
|
|||||||
[SerializeField] private TextMeshProUGUI _label;
|
[SerializeField] private TextMeshProUGUI _label;
|
||||||
[SerializeField] private List<GameObject> _content = new();
|
[SerializeField] private List<GameObject> _content = new();
|
||||||
|
|
||||||
|
[SerializeField] private bool _isEnabled = true;
|
||||||
|
|
||||||
private Action<T> _onSelected;
|
private Action<T> _onSelected;
|
||||||
private bool _isSelected;
|
private bool _isSelected;
|
||||||
|
|
||||||
|
private readonly int _canDisabled = Animator.StringToHash("CanDisabled");
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
|
if (_isEnabled == false)
|
||||||
|
{
|
||||||
|
_animator.SetBool(_canDisabled, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_isSelected)
|
if (_isSelected)
|
||||||
{
|
{
|
||||||
_animator.SetTrigger(nameof(DefaultAnimatorParams.Selected));
|
_animator.SetTrigger(nameof(DefaultAnimatorParams.Selected));
|
||||||
|
@ -29,11 +29,6 @@ public void Initialize(Action<T> onTabSelected)
|
|||||||
tab.Initialize(OnTabClicked);
|
tab.Initialize(OnTabClicked);
|
||||||
_tabLookup[tab.TabType] = tab;
|
_tabLookup[tab.TabType] = tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_tabButtons.Count > 0)
|
|
||||||
{
|
|
||||||
SelectTab(_tabButtons[0].TabType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTabClicked(T type)
|
private void OnTabClicked(T type)
|
||||||
@ -52,6 +47,14 @@ public void SelectTab(T type)
|
|||||||
_onTabSelected?.Invoke(type);
|
_onTabSelected?.Invoke(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SelectFirstTab()
|
||||||
|
{
|
||||||
|
if (_tabButtons.Count > 0)
|
||||||
|
{
|
||||||
|
SelectTab(_tabButtons[0].TabType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Move(int direction)
|
public void Move(int direction)
|
||||||
{
|
{
|
||||||
var tabTypes = TabOrder;
|
var tabTypes = TabOrder;
|
||||||
|
Loading…
Reference in New Issue
Block a user