Merge branch 'main' into DamianBranch
This commit is contained in:
BIN
Assets/Art/Textures/Cards/CardGraphics/Card_NamePlaque3.png
Normal file
BIN
Assets/Art/Textures/Cards/CardGraphics/Card_NamePlaque3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
169
Assets/Art/Textures/Cards/CardGraphics/Card_NamePlaque3.png.meta
Normal file
169
Assets/Art/Textures/Cards/CardGraphics/Card_NamePlaque3.png.meta
Normal file
@@ -0,0 +1,169 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bca79d74db3d9745a29fc753e1cad3e
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: -2632133597891324841
|
||||
second: AEblerup_CardAssets_Border3_0
|
||||
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: 1
|
||||
spriteMeshType: 1
|
||||
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: iOS
|
||||
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: AEblerup_CardAssets_Border3_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 238
|
||||
y: 308
|
||||
width: 1508
|
||||
height: 353
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 75411583078c87bd0800000000000000
|
||||
internalID: -2632133597891324841
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable:
|
||||
AEblerup_CardAssets_Border3_0: -2632133597891324841
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -17,7 +17,7 @@ namespace Editor.CardSystem
|
||||
{
|
||||
// Paths
|
||||
private const string CardDefinitionsPath = "Assets/Data/Cards";
|
||||
private const string MenuPath = "AppleHills/Card Editor";
|
||||
private const string MenuPath = "AppleHills/Cards/Card Editor";
|
||||
private const string CardUIPrefabPath = "Assets/Prefabs/UI/CardsSystem/Cards/Card.prefab";
|
||||
private const string CardVisualConfigPath = CardDefinitionsPath + "/CardVisualConfig.asset";
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace AppleHills.Editor
|
||||
private int boosterCount = 0;
|
||||
private string lastEventMessage = "";
|
||||
|
||||
[MenuItem("Tools/Card System/Live Collection Preview")]
|
||||
[MenuItem("AppleHills/Cards/Live Collection Preview")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
CardSystemLivePreview window = GetWindow<CardSystemLivePreview>("Card Collection Live");
|
||||
|
||||
@@ -19,6 +19,15 @@ namespace Editor.CardSystem
|
||||
private int boosterPacksToAdd = 3;
|
||||
private int cardsToGenerate = 10;
|
||||
|
||||
// Auto-add toggles (always editable)
|
||||
private bool autoAddBoosters = false;
|
||||
private bool autoAddCards = false;
|
||||
|
||||
// Scheduling for delayed auto-add after entering play mode
|
||||
private double scheduledAddTime = -1.0;
|
||||
private bool scheduledBoosters = false;
|
||||
private bool scheduledCards = false;
|
||||
|
||||
// Debug Info
|
||||
private int currentBoosterCount;
|
||||
private int totalCardsInCollection;
|
||||
@@ -27,7 +36,7 @@ namespace Editor.CardSystem
|
||||
// UI State
|
||||
private Vector2 scrollPosition;
|
||||
|
||||
[MenuItem("AppleHills/Card System Tester")]
|
||||
[MenuItem("AppleHills/Cards/Card System Tester")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<CardSystemTesterWindow>(false, "Card System Tester", true);
|
||||
@@ -37,11 +46,13 @@ namespace Editor.CardSystem
|
||||
private void OnEnable()
|
||||
{
|
||||
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
||||
EditorApplication.update += EditorUpdate;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
|
||||
EditorApplication.update -= EditorUpdate;
|
||||
}
|
||||
|
||||
private void OnPlayModeStateChanged(PlayModeStateChange state)
|
||||
@@ -49,15 +60,52 @@ namespace Editor.CardSystem
|
||||
if (state == PlayModeStateChange.EnteredPlayMode)
|
||||
{
|
||||
RefreshDebugInfo();
|
||||
|
||||
// Schedule auto-adds after 1 second if toggles are enabled
|
||||
if (autoAddBoosters || autoAddCards)
|
||||
{
|
||||
scheduledAddTime = EditorApplication.timeSinceStartup + 1.0;
|
||||
scheduledBoosters = autoAddBoosters;
|
||||
scheduledCards = autoAddCards;
|
||||
}
|
||||
}
|
||||
else if (state == PlayModeStateChange.ExitingPlayMode)
|
||||
{
|
||||
lastActionMessage = "";
|
||||
// clear any scheduled actions when leaving play mode
|
||||
scheduledAddTime = -1.0;
|
||||
scheduledBoosters = false;
|
||||
scheduledCards = false;
|
||||
}
|
||||
|
||||
Repaint();
|
||||
}
|
||||
|
||||
// Polling update used to execute scheduled actions after a delay
|
||||
private void EditorUpdate()
|
||||
{
|
||||
if (scheduledAddTime > 0 && EditorApplication.timeSinceStartup >= scheduledAddTime)
|
||||
{
|
||||
// perform scheduled actions
|
||||
if (scheduledBoosters)
|
||||
{
|
||||
AddBoosterPacks();
|
||||
}
|
||||
|
||||
if (scheduledCards)
|
||||
{
|
||||
GenerateRandomCards();
|
||||
}
|
||||
|
||||
// clear schedule
|
||||
scheduledAddTime = -1.0;
|
||||
scheduledBoosters = false;
|
||||
scheduledCards = false;
|
||||
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
|
||||
@@ -90,12 +138,23 @@ namespace Editor.CardSystem
|
||||
{
|
||||
EditorGUILayout.LabelField("Test Settings", EditorStyles.boldLabel);
|
||||
|
||||
// Booster pack slider with always-editable auto-add toggle
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(!Application.isPlaying);
|
||||
|
||||
boosterPacksToAdd = EditorGUILayout.IntSlider("Booster Packs to Add", boosterPacksToAdd, 1, 10);
|
||||
cardsToGenerate = EditorGUILayout.IntSlider("Cards to Generate", cardsToGenerate, 1, 100);
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
GUILayout.FlexibleSpace();
|
||||
autoAddBoosters = EditorGUILayout.ToggleLeft("Auto Add", autoAddBoosters, GUILayout.Width(110));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
// Card generation slider with always-editable auto-add toggle
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(!Application.isPlaying);
|
||||
cardsToGenerate = EditorGUILayout.IntSlider("Cards to Generate", cardsToGenerate, 1, 100);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
GUILayout.FlexibleSpace();
|
||||
autoAddCards = EditorGUILayout.ToggleLeft("Auto Add", autoAddCards, GUILayout.Width(110));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void DrawDebugInfo()
|
||||
|
||||
3
Assets/Editor/Developer.meta
Normal file
3
Assets/Editor/Developer.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 101d8cab829741d0bafb3512ff5ca313
|
||||
timeCreated: 1762504148
|
||||
@@ -17,7 +17,7 @@ namespace Editor
|
||||
private bool hasScanned;
|
||||
private int componentsFound;
|
||||
|
||||
[MenuItem("AppleHills/Remove InteractableBase Components")]
|
||||
[MenuItem("AppleHills/Developer/Remove InteractableBase Components")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<RemoveInteractableBaseComponents>("Remove InteractableBase");
|
||||
@@ -12,7 +12,7 @@ namespace Editor
|
||||
private Vector2 scrollPosition;
|
||||
private bool hasScanned = false;
|
||||
|
||||
[MenuItem("AppleHills/Remove Old Interactable References")]
|
||||
[MenuItem("AppleHills/Developer/Remove Old Interactable References")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<RemoveOldInteractableReferences>("Clean Old Interactables");
|
||||
@@ -17,7 +17,7 @@ namespace Editor
|
||||
private bool showPrefabs = true;
|
||||
private bool showScenes = true;
|
||||
|
||||
[MenuItem("Tools/AppleHills/Migrate StateMachines to Saveable")]
|
||||
[MenuItem("AppleHills/Developer/Migrate StateMachines to Saveable")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<StateMachineMigrationTool>("StateMachine Migration");
|
||||
@@ -15,7 +15,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
private Dictionary<string, SerializedObject> serializedSettingsObjects = new Dictionary<string, SerializedObject>();
|
||||
private GUIStyle headerStyle;
|
||||
|
||||
[MenuItem("AppleHills/Developer Settings Editor")]
|
||||
[MenuItem("AppleHills/Settings/Developer Settings Editor")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
GetWindow<DeveloperSettingsEditorWindow>("Developer Settings");
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace AppleHills.Core.Settings.Editor
|
||||
private Dictionary<string, SerializedObject> serializedSettingsObjects = new Dictionary<string, SerializedObject>();
|
||||
private GUIStyle headerStyle;
|
||||
|
||||
[MenuItem("AppleHills/Settings Editor")]
|
||||
[MenuItem("AppleHills/Settings/Settings Editor")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
GetWindow<SettingsEditorWindow>("Game Settings");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,13 +26,12 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 498445838423597154}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5027301639700053608}
|
||||
- {fileID: 6998531714563205983}
|
||||
- {fileID: 2081116343754364062}
|
||||
- {fileID: 4830022034953347571}
|
||||
- {fileID: 7968396929263690413}
|
||||
@@ -70,7 +69,6 @@ MonoBehaviour:
|
||||
PageName: Booster Opening Page
|
||||
transitionDuration: 0.3
|
||||
canvasGroup: {fileID: 7671014600744692184}
|
||||
closeButton: {fileID: 9195578165816196696}
|
||||
boosterPackPrefab: {fileID: 1439929750438628637, guid: cff5eaa9e8cc26a439e7b36345916468, type: 3}
|
||||
bottomRightSlots: {fileID: 415627682025321105}
|
||||
centerOpeningSlot: {fileID: 3371630871680769077}
|
||||
@@ -81,6 +79,7 @@ MonoBehaviour:
|
||||
boosterDisappearDuration: 0.5
|
||||
impulseSource: {fileID: 4448843358972162772}
|
||||
openingParticleSystem: {fileID: 0}
|
||||
albumIcon: {fileID: 0}
|
||||
--- !u!114 &4448843358972162772
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -404,138 +403,6 @@ MonoBehaviour:
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
curveHeight: 50
|
||||
--- !u!1 &6017052972121068920
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6998531714563205983}
|
||||
- component: {fileID: 7990422945290858532}
|
||||
- component: {fileID: 8362552417907629651}
|
||||
- component: {fileID: 9195578165816196696}
|
||||
m_Layer: 0
|
||||
m_Name: ExitButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6998531714563205983
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6017052972121068920}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5228380266581535650}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 106, y: -98}
|
||||
m_SizeDelta: {x: 120, y: 120}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7990422945290858532
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6017052972121068920}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8362552417907629651
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6017052972121068920}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 607773040016097035, guid: ee014bd71cac2bc4ab845f435726f383, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &9195578165816196696
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6017052972121068920}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Button
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 8362552417907629651}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 0}
|
||||
m_TargetAssemblyTypeName: UI.CardSystem.AlbumViewPage, AppleHillsScripts
|
||||
m_MethodName: ExitAlbum
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1001 &610246570171281800
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -968,7 +835,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6647899082618247385, guid: 561f7c561a416e54e9bf1c2af2f3f4ef, type: 3}
|
||||
propertyPath: hideImageOnPlay
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6647899082618247385, guid: 561f7c561a416e54e9bf1c2af2f3f4ef, type: 3}
|
||||
propertyPath: occupantScale.x
|
||||
|
||||
215
Assets/Prefabs/UI/CardsSystem/Cards/AlbumCard.prefab
Normal file
215
Assets/Prefabs/UI/CardsSystem/Cards/AlbumCard.prefab
Normal file
@@ -0,0 +1,215 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3697348702925017591
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8576570241677955255}
|
||||
- component: {fileID: 5397984527285824388}
|
||||
- component: {fileID: 5080215318866393190}
|
||||
m_Layer: 5
|
||||
m_Name: AlbumCard
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8576570241677955255
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697348702925017591}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 593327658551090324}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 540}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &5397984527285824388
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697348702925017591}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 2
|
||||
m_AspectRatio: 0.7407407
|
||||
--- !u!114 &5080215318866393190
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697348702925017591}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 258a530448814715b5ec19737df2a658, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.AlbumCard
|
||||
cardDisplay: {fileID: 3062738042043309247}
|
||||
backdropImage: {fileID: 0}
|
||||
enlargedScale: 2.5
|
||||
scaleDuration: 0.3
|
||||
--- !u!1001 &2530689326119009629
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8576570241677955255}
|
||||
m_Modifications:
|
||||
- target: {fileID: 790099756778783334, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1802458852284665438, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4210468743547155963, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5533787515014034956, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Card
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7441149886460635393, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 55
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
--- !u!224 &593327658551090324 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
m_PrefabInstance: {fileID: 2530689326119009629}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &3062738042043309247 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 693510968212398562, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
m_PrefabInstance: {fileID: 2530689326119009629}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 72cb26621865420aa763a66c06eb7f6d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.CardDisplay
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d8cc8d9238eec34b8e600e7050e2979
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
344
Assets/Prefabs/UI/CardsSystem/Cards/AlbumCardSlot.prefab
Normal file
344
Assets/Prefabs/UI/CardsSystem/Cards/AlbumCardSlot.prefab
Normal file
@@ -0,0 +1,344 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3676527493138140132
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8845385832003591182}
|
||||
- component: {fileID: 4571551530005540356}
|
||||
- component: {fileID: 5228938363013129740}
|
||||
m_Layer: 5
|
||||
m_Name: BackgroundImage
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8845385832003591182
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3676527493138140132}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8880693373090345290}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4571551530005540356
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3676527493138140132}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5228938363013129740
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3676527493138140132}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.3018868, g: 0.3018868, b: 0.3018868, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 1371845613413874417, guid: ee00b57d42ea1d545bc75775545d86e7, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &3697348702925017591
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8576570241677955255}
|
||||
- component: {fileID: 2515648508668674600}
|
||||
- component: {fileID: 5397984527285824388}
|
||||
m_Layer: 5
|
||||
m_Name: AlbumCardSlot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8576570241677955255
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697348702925017591}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8880693373090345290}
|
||||
- {fileID: 4420447191717448385}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 540}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &2515648508668674600
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697348702925017591}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 514a349ba18d4842bc4292cb034f0d76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.AlbumCardSlot
|
||||
slotIndex: -1
|
||||
isLocked: 0
|
||||
hideImageOnPlay: 0
|
||||
filterByType: 0
|
||||
allowedTypeNames: []
|
||||
occupantSizeMode: 0
|
||||
occupantScale: {x: 1, y: 1, z: 1}
|
||||
scaleTransitionDuration: 0.3
|
||||
targetCardDefinition: {fileID: 0}
|
||||
albumCardPrefab: {fileID: 3697348702925017591, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
previewCardDisplay: {fileID: 2297523098913213162}
|
||||
previewEnlargedScale: 2.5
|
||||
previewScaleDuration: 0.3
|
||||
--- !u!114 &5397984527285824388
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3697348702925017591}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.AspectRatioFitter
|
||||
m_AspectMode: 2
|
||||
m_AspectRatio: 0.7407407
|
||||
--- !u!1 &3957516808955976615
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8880693373090345290}
|
||||
m_Layer: 5
|
||||
m_Name: Visuals
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8880693373090345290
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3957516808955976615}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8845385832003591182}
|
||||
m_Father: {fileID: 8576570241677955255}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1001 &1620637915280911112
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8576570241677955255}
|
||||
m_Modifications:
|
||||
- target: {fileID: 790099756778783334, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 790099756778783334, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: -0.030929565
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 790099756778783334, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 6.3459015
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1802458852284665438, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4210468743547155963, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5533787515014034956, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Card
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7441149886460635393, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 44.3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
--- !u!114 &2297523098913213162 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 693510968212398562, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
m_PrefabInstance: {fileID: 1620637915280911112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 72cb26621865420aa763a66c06eb7f6d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.CardDisplay
|
||||
--- !u!224 &4420447191717448385 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
m_PrefabInstance: {fileID: 1620637915280911112}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c260b7a90f2306840a21b8a898010e5a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
358
Assets/Prefabs/UI/CardsSystem/Cards/AlbumPlacementCard.prefab
Normal file
358
Assets/Prefabs/UI/CardsSystem/Cards/AlbumPlacementCard.prefab
Normal file
@@ -0,0 +1,358 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1275563675283742273
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4689562168107797719}
|
||||
- component: {fileID: 1691790559549813443}
|
||||
m_Layer: 0
|
||||
m_Name: AlbumPlacementCard
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4689562168107797719
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1275563675283742273}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 7701563473015326516}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 400, y: 540}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1691790559549813443
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1275563675283742273}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 706803638ea24880bae19c87d3851ce6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.AlbumCardDraggable
|
||||
moveSpeed: 1500
|
||||
smoothMovement: 0
|
||||
snapDuration: 0.3
|
||||
visual: {fileID: 0}
|
||||
isSelectable: 1
|
||||
selectionOffset: 10
|
||||
flippableCard: {fileID: 3814888273534605961}
|
||||
holdRevealDelay: 0.3
|
||||
--- !u!1001 &9020921157083249943
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 4689562168107797719}
|
||||
m_Modifications:
|
||||
- target: {fileID: 800304281239603981, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1571786155082116174, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1571786155082116174, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1571786155082116174, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1571786155082116174, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1571786155082116174, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1571786155082116174, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1657266364921102667, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1657266364921102667, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1657266364921102667, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1657266364921102667, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1657266364921102667, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1657266364921102667, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2705687956353102842, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2705687956353102842, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2705687956353102842, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2705687956353102842, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2705687956353102842, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2705687956353102842, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3944615060647018691, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3944615060647018691, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3944615060647018691, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4874164524383443800, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4874164524383443800, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4874164524383443800, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4874164524383443800, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4874164524383443800, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4874164524383443800, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5044057968005998777, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5314682225669040030, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: albumCard
|
||||
value:
|
||||
objectReference: {fileID: 5164901602697649867}
|
||||
- target: {fileID: 5314682225669040030, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: cardDisplay
|
||||
value:
|
||||
objectReference: {fileID: 3147152248387533330}
|
||||
- target: {fileID: 5314682225669040030, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: enableIdleHover
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5314682225669040030, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: idleHoverHeight
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6193987373793698945, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7308531005971043100, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595097391291779023, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595097391291779023, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595097391291779023, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595097391291779023, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595097391291779023, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595097391291779023, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9060030918047515996, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: FlippableCardPrefab
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
--- !u!114 &3147152248387533330 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 6240953021224011525, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
m_PrefabInstance: {fileID: 9020921157083249943}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 72cb26621865420aa763a66c06eb7f6d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.CardDisplay
|
||||
--- !u!114 &3814888273534605961 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 5314682225669040030, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
m_PrefabInstance: {fileID: 9020921157083249943}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ffa05ec4ecbd4cc485e2127683c29f09, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.FlippableCard
|
||||
--- !u!114 &5164901602697649867 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 4223766615757628380, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
m_PrefabInstance: {fileID: 9020921157083249943}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 258a530448814715b5ec19737df2a658, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.AlbumCard
|
||||
--- !u!224 &7701563473015326516 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 1716378143019989539, guid: e16716863eca4704fbfabef5a699b5aa, type: 3}
|
||||
m_PrefabInstance: {fileID: 9020921157083249943}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aca553283b12f314795f62d785d01912
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -292,10 +292,10 @@ RectTransform:
|
||||
- {fileID: 1802458852284665438}
|
||||
m_Father: {fileID: 701288322681682632}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.07, y: 0.06}
|
||||
m_AnchorMax: {x: 0.93, y: 0.27}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0.09163373, y: 0.071898624}
|
||||
m_AnchorMax: {x: 0.90400004, y: 0.27}
|
||||
m_AnchoredPosition: {x: 0.8335724, y: -0.067733765}
|
||||
m_SizeDelta: {x: 0, y: 0.15485442}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!222 &4296998830042904757
|
||||
CanvasRenderer:
|
||||
@@ -325,7 +325,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -3310850967021205615, guid: bf14f631f4b34e74d83c20a1dd671422, type: 3}
|
||||
m_Sprite: {fileID: -2632133597891324841, guid: 1bca79d74db3d9745a29fc753e1cad3e, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -461,7 +461,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 2}
|
||||
m_SizeDelta: {x: 200, y: 400}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &693510968212398562
|
||||
MonoBehaviour:
|
||||
@@ -656,7 +656,7 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 0.1
|
||||
m_fontSize: 44.3
|
||||
m_fontSizeBase: 0.95663
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 1
|
||||
@@ -694,7 +694,7 @@ MonoBehaviour:
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0.6442871, y: -0.467865, z: -0.4551239, w: -0.1640625}
|
||||
m_margin: {x: 18.807068, y: -0.467865, z: 18.593826, w: -0.1640625}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
|
||||
33
Assets/Prefabs/UI/CardsSystem/Cards/EmptyPrefab.prefab
Normal file
33
Assets/Prefabs/UI/CardsSystem/Cards/EmptyPrefab.prefab
Normal file
@@ -0,0 +1,33 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &666061725648654652
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8002664199913995372}
|
||||
m_Layer: 0
|
||||
m_Name: EmptyPrefab
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8002664199913995372
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 666061725648654652}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a608484c63e38d643b8a0f094b30e7ed
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -243,7 +243,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6667510642920868813}
|
||||
- {fileID: 800304281239603981}
|
||||
m_Father: {fileID: 1716378143019989539}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -1015,7 +1015,8 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.FlippableCard
|
||||
cardBackObject: {fileID: 2592418251725585151}
|
||||
cardFrontObject: {fileID: 2691095965985708622}
|
||||
cardDisplay: {fileID: 9096468343956982758}
|
||||
cardDisplay: {fileID: 6240953021224011525}
|
||||
albumCard: {fileID: 4223766615757628380}
|
||||
enableIdleHover: 1
|
||||
idleHoverHeight: 10
|
||||
idleHoverDuration: 1.5
|
||||
@@ -1028,7 +1029,7 @@ MonoBehaviour:
|
||||
progressBarContainer: {fileID: 1938654216571238436}
|
||||
cardsToUpgrade: 5
|
||||
enlargedScale: 1.5
|
||||
--- !u!1001 &8620731150807558660
|
||||
--- !u!1001 &8943403053347003322
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
@@ -1036,136 +1037,139 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 1318588240326811233}
|
||||
m_Modifications:
|
||||
- target: {fileID: 790099756778783334, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 1833043711021369510, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1802458852284665438, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 3019715237329649467, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 3697348702925017591, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: AlbumCard
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4187589325650506499, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5378230129755544441, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5378230129755544441, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5378230129755544441, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 1
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
value: 540
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
value: 16
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
- target: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4210468743547155963, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5533787515014034956, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Card
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7441149886460635393, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_fontSize
|
||||
value: 55
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7619421269260494372, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
--- !u!224 &6667510642920868813 stripped
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
--- !u!224 &800304281239603981 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 3108957999325520329, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
m_PrefabInstance: {fileID: 8620731150807558660}
|
||||
m_CorrespondingSourceObject: {fileID: 8576570241677955255, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
m_PrefabInstance: {fileID: 8943403053347003322}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &9096468343956982758 stripped
|
||||
--- !u!114 &4223766615757628380 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 693510968212398562, guid: 6d6e64f153ccde149bede8e82351d3c4, type: 3}
|
||||
m_PrefabInstance: {fileID: 8620731150807558660}
|
||||
m_CorrespondingSourceObject: {fileID: 5080215318866393190, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
m_PrefabInstance: {fileID: 8943403053347003322}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 258a530448814715b5ec19737df2a658, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: AppleHillsScripts::UI.CardSystem.AlbumCard
|
||||
--- !u!114 &6240953021224011525 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 3062738042043309247, guid: 1d8cc8d9238eec34b8e600e7050e2979, type: 3}
|
||||
m_PrefabInstance: {fileID: 8943403053347003322}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -119,6 +119,107 @@ NavMeshSettings:
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &112295772
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 112295776}
|
||||
- component: {fileID: 112295775}
|
||||
- component: {fileID: 112295774}
|
||||
- component: {fileID: 112295773}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &112295773
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 112295772}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.GraphicRaycaster
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &112295774
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 112295772}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!223 &112295775
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 112295772}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!224 &112295776
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 112295772}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!1 &205824278
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -178,6 +279,14 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 595272504056402413, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 825332419457559166, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 986705326607357273, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
@@ -226,6 +335,26 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1015781254734888848, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1015781254734888848, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2195640027358863122, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2473734400733064735, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2933317804819996964, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3283099424197577028, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
@@ -250,10 +379,70 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3387604480156603269, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5914855795585001110, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5990642783362064446, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6305745178180749265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6745067370585802576, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6840374429432680527, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6850526187527119454, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6972626947951714265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6972626947951714265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6972626947951714265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6972626947951714265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6972626947951714265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6972626947951714265, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7104076737882304566, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7142802033631930748, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7561458520277380541, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7727649523464928408, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
@@ -382,6 +571,42 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8264872370053686409, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8595621610758973760, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8686904468228409787, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8686904468228409787, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8686904468228409787, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8686904468228409787, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8686904468228409787, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8686904468228409787, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8742263962805741772, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8962991431592255329, guid: 4684df63af6398f4f9f624a35023f8d2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
@@ -643,3 +868,4 @@ SceneRoots:
|
||||
- {fileID: 205824280}
|
||||
- {fileID: 2067824743}
|
||||
- {fileID: 445623521}
|
||||
- {fileID: 112295776}
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Data.CardSystem
|
||||
{
|
||||
public int boosterPackCount;
|
||||
public List<SavedCardEntry> cards = new List<SavedCardEntry>();
|
||||
public List<SavedCardEntry> pendingRevealCards = new List<SavedCardEntry>();
|
||||
public List<string> placedInAlbumCardIds = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Bootstrap;
|
||||
using Core;
|
||||
@@ -23,6 +24,10 @@ namespace Data.CardSystem
|
||||
|
||||
// Runtime data - will be serialized for save/load
|
||||
[SerializeField] private CardInventory playerInventory = new CardInventory();
|
||||
|
||||
// Album system - cards waiting to be placed in album
|
||||
private List<CardData> _pendingRevealCards = new List<CardData>();
|
||||
private HashSet<string> _placedInAlbumCardIds = new HashSet<string>();
|
||||
|
||||
// Dictionary to quickly look up card definitions by ID
|
||||
private Dictionary<string, CardDefinition> _definitionLookup = new Dictionary<string, CardDefinition>();
|
||||
@@ -32,6 +37,8 @@ namespace Data.CardSystem
|
||||
public event Action<CardData> OnCardCollected;
|
||||
public event Action<CardData> OnCardRarityUpgraded;
|
||||
public event Action<int> OnBoosterCountChanged;
|
||||
public event Action<CardData> OnPendingCardAdded;
|
||||
public event Action<CardData> OnCardPlacedInAlbum;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -175,19 +182,34 @@ namespace Data.CardSystem
|
||||
|
||||
/// <summary>
|
||||
/// Check if a card is new to the player's collection at the specified rarity
|
||||
/// Checks both owned inventory and pending reveal queue
|
||||
/// </summary>
|
||||
/// <param name="cardData">The card to check</param>
|
||||
/// <param name="existingCard">Out parameter - the existing card if found, null otherwise</param>
|
||||
/// <returns>True if this is a new card at this rarity, false if already owned</returns>
|
||||
/// <returns>True if this is a new card at this rarity, false if already owned or pending</returns>
|
||||
public bool IsCardNew(CardData cardData, out CardData existingCard)
|
||||
{
|
||||
// First check inventory (cards already placed in album)
|
||||
if (playerInventory.HasCard(cardData.DefinitionId, cardData.Rarity))
|
||||
{
|
||||
existingCard = playerInventory.GetCard(cardData.DefinitionId, cardData.Rarity);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Then check pending reveal queue (cards waiting to be placed)
|
||||
CardData pendingCard = _pendingRevealCards.FirstOrDefault(c =>
|
||||
c.DefinitionId == cardData.DefinitionId && c.Rarity == cardData.Rarity);
|
||||
|
||||
if (pendingCard != null)
|
||||
{
|
||||
// Return the actual pending card with its real CopiesOwned count
|
||||
// Pending status is just about placement location, not copy count
|
||||
existingCard = pendingCard;
|
||||
return false; // Not new - already in pending queue
|
||||
}
|
||||
|
||||
existingCard = null;
|
||||
return true;
|
||||
return true; // Truly new - not in inventory or pending
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -201,28 +223,46 @@ namespace Data.CardSystem
|
||||
|
||||
/// <summary>
|
||||
/// Adds a card to the player's inventory, handles duplicates
|
||||
/// Checks both inventory and pending lists to find existing cards
|
||||
/// </summary>
|
||||
private void AddCardToInventory(CardData card)
|
||||
{
|
||||
// Check if the player already has this card at this rarity
|
||||
// Guard: Ensure card has at least 1 copy
|
||||
if (card.CopiesOwned <= 0)
|
||||
{
|
||||
card.CopiesOwned = 1;
|
||||
Logging.Warning($"[CardSystemManager] Card '{card.Name}' had {card.CopiesOwned} copies, setting to 1");
|
||||
}
|
||||
|
||||
// First check inventory (cards already placed in album)
|
||||
if (playerInventory.HasCard(card.DefinitionId, card.Rarity))
|
||||
{
|
||||
CardData existingCard = playerInventory.GetCard(card.DefinitionId, card.Rarity);
|
||||
existingCard.CopiesOwned++;
|
||||
|
||||
// Note: Upgrades are now handled separately in BoosterOpeningPage
|
||||
// We don't auto-upgrade here anymore
|
||||
|
||||
Logging.Debug($"[CardSystemManager] Added duplicate card '{card.Name}' ({card.Rarity}). Now have {existingCard.CopiesOwned} copies.");
|
||||
Logging.Debug($"[CardSystemManager] Added duplicate card '{card.Name}' ({card.Rarity}) to INVENTORY. Now have {existingCard.CopiesOwned} copies.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
// Then check pending reveal queue
|
||||
CardData pendingCard = _pendingRevealCards.FirstOrDefault(c =>
|
||||
c.DefinitionId == card.DefinitionId && c.Rarity == card.Rarity);
|
||||
|
||||
if (pendingCard != null)
|
||||
{
|
||||
// Add new card at this rarity
|
||||
playerInventory.AddCard(card);
|
||||
OnCardCollected?.Invoke(card);
|
||||
// Card already in pending - increment its copy count
|
||||
pendingCard.CopiesOwned++;
|
||||
|
||||
Logging.Debug($"[CardSystemManager] Added new card '{card.Name}' ({card.Rarity}) to collection.");
|
||||
Logging.Debug($"[CardSystemManager] Added duplicate card '{card.Name}' ({card.Rarity}) to PENDING. Now have {pendingCard.CopiesOwned} copies pending.");
|
||||
return;
|
||||
}
|
||||
|
||||
// This is a NEW card (never owned at this rarity before)
|
||||
// Add to pending reveal list instead of inventory
|
||||
_pendingRevealCards.Add(card);
|
||||
OnPendingCardAdded?.Invoke(card);
|
||||
|
||||
Logging.Debug($"[CardSystemManager] Added new card '{card.Name}' ({card.Rarity}) to pending reveal queue.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -286,27 +326,33 @@ namespace Data.CardSystem
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all cards from the player's collection
|
||||
/// Returns all cards from the player's collection (both owned and pending)
|
||||
/// </summary>
|
||||
public List<CardData> GetAllCollectedCards()
|
||||
{
|
||||
return playerInventory.GetAllCards();
|
||||
List<CardData> allCards = new List<CardData>(playerInventory.GetAllCards());
|
||||
allCards.AddRange(_pendingRevealCards);
|
||||
return allCards;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns cards from a specific zone
|
||||
/// Returns cards from a specific zone (both owned and pending)
|
||||
/// </summary>
|
||||
public List<CardData> GetCardsByZone(CardZone zone)
|
||||
{
|
||||
return playerInventory.GetCardsByZone(zone);
|
||||
List<CardData> zoneCards = new List<CardData>(playerInventory.GetCardsByZone(zone));
|
||||
zoneCards.AddRange(_pendingRevealCards.Where(c => c.Zone == zone));
|
||||
return zoneCards;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns cards of a specific rarity
|
||||
/// Returns cards of a specific rarity (both owned and pending)
|
||||
/// </summary>
|
||||
public List<CardData> GetCardsByRarity(CardRarity rarity)
|
||||
{
|
||||
return playerInventory.GetCardsByRarity(rarity);
|
||||
List<CardData> rarityCards = new List<CardData>(playerInventory.GetCardsByRarity(rarity));
|
||||
rarityCards.AddRange(_pendingRevealCards.Where(c => c.Rarity == rarity));
|
||||
return rarityCards;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -318,25 +364,38 @@ namespace Data.CardSystem
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether a specific card definition has been collected (at any rarity)
|
||||
/// Returns whether a specific card definition has been collected (at any rarity, in inventory or pending)
|
||||
/// </summary>
|
||||
public bool IsCardCollected(string definitionId)
|
||||
{
|
||||
// Check if the card exists at any rarity
|
||||
// Check inventory at any rarity
|
||||
foreach (CardRarity rarity in System.Enum.GetValues(typeof(CardRarity)))
|
||||
{
|
||||
if (playerInventory.HasCard(definitionId, rarity))
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check pending reveal queue
|
||||
if (_pendingRevealCards.Any(c => c.DefinitionId == definitionId))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets total unique card count
|
||||
/// Gets total unique card count (both owned and pending)
|
||||
/// </summary>
|
||||
public int GetUniqueCardCount()
|
||||
{
|
||||
return playerInventory.GetUniqueCardCount();
|
||||
int inventoryCount = playerInventory.GetUniqueCardCount();
|
||||
|
||||
// Count unique cards in pending that aren't already in inventory
|
||||
int pendingUniqueCount = _pendingRevealCards
|
||||
.Select(c => new { c.DefinitionId, c.Rarity })
|
||||
.Distinct()
|
||||
.Count(pc => !playerInventory.HasCard(pc.DefinitionId, pc.Rarity));
|
||||
|
||||
return inventoryCount + pendingUniqueCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -381,19 +440,23 @@ namespace Data.CardSystem
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the count of cards by rarity
|
||||
/// Returns the count of cards by rarity (both owned and pending)
|
||||
/// </summary>
|
||||
public int GetCardCountByRarity(CardRarity rarity)
|
||||
{
|
||||
return playerInventory.GetCardsByRarity(rarity).Count;
|
||||
int inventoryCount = playerInventory.GetCardsByRarity(rarity).Count;
|
||||
int pendingCount = _pendingRevealCards.Count(c => c.Rarity == rarity);
|
||||
return inventoryCount + pendingCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the count of cards by zone
|
||||
/// Returns the count of cards by zone (both owned and pending)
|
||||
/// </summary>
|
||||
public int GetCardCountByZone(CardZone zone)
|
||||
{
|
||||
return playerInventory.GetCardsByZone(zone).Count;
|
||||
int inventoryCount = playerInventory.GetCardsByZone(zone).Count;
|
||||
int pendingCount = _pendingRevealCards.Count(c => c.Zone == zone);
|
||||
return inventoryCount + pendingCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -428,6 +491,121 @@ namespace Data.CardSystem
|
||||
return (float)collectedOfRarity / totalOfRarity * 100f;
|
||||
}
|
||||
|
||||
#region Album System
|
||||
|
||||
/// <summary>
|
||||
/// Returns all cards waiting to be placed in the album
|
||||
/// </summary>
|
||||
public List<CardData> GetPendingRevealCards()
|
||||
{
|
||||
return new List<CardData>(_pendingRevealCards);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a card by definition ID and rarity from either inventory or pending
|
||||
/// Returns the actual card reference so changes persist
|
||||
/// </summary>
|
||||
/// <param name="definitionId">Card definition ID</param>
|
||||
/// <param name="rarity">Card rarity</param>
|
||||
/// <param name="isFromPending">Out parameter - true if card is from pending, false if from inventory</param>
|
||||
/// <returns>The card data if found, null otherwise</returns>
|
||||
public CardData GetCard(string definitionId, CardRarity rarity, out bool isFromPending)
|
||||
{
|
||||
// Check inventory first
|
||||
if (playerInventory.HasCard(definitionId, rarity))
|
||||
{
|
||||
isFromPending = false;
|
||||
return playerInventory.GetCard(definitionId, rarity);
|
||||
}
|
||||
|
||||
// Check pending
|
||||
CardData pendingCard = _pendingRevealCards.FirstOrDefault(c =>
|
||||
c.DefinitionId == definitionId && c.Rarity == rarity);
|
||||
|
||||
if (pendingCard != null)
|
||||
{
|
||||
isFromPending = true;
|
||||
return pendingCard;
|
||||
}
|
||||
|
||||
isFromPending = false;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a card by definition ID and rarity from either inventory or pending (simplified overload)
|
||||
/// </summary>
|
||||
public CardData GetCard(string definitionId, CardRarity rarity)
|
||||
{
|
||||
return GetCard(definitionId, rarity, out _);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update a card's data in whichever list it's in (inventory or pending)
|
||||
/// Useful for incrementing CopiesOwned, upgrading rarity, etc.
|
||||
/// </summary>
|
||||
/// <param name="definitionId">Card definition ID</param>
|
||||
/// <param name="rarity">Card rarity</param>
|
||||
/// <param name="updateAction">Action to perform on the card</param>
|
||||
/// <returns>True if card was found and updated, false otherwise</returns>
|
||||
public bool UpdateCard(string definitionId, CardRarity rarity, System.Action<CardData> updateAction)
|
||||
{
|
||||
CardData card = GetCard(definitionId, rarity, out bool isFromPending);
|
||||
|
||||
if (card != null)
|
||||
{
|
||||
updateAction?.Invoke(card);
|
||||
Logging.Debug($"[CardSystemManager] Updated card '{card.Name}' in {(isFromPending ? "pending" : "inventory")}");
|
||||
return true;
|
||||
}
|
||||
|
||||
Logging.Warning($"[CardSystemManager] Could not find card with ID '{definitionId}' and rarity '{rarity}' to update");
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Marks a card as placed in the album
|
||||
/// Moves it from pending reveal to owned inventory
|
||||
/// </summary>
|
||||
public void MarkCardAsPlaced(CardData card)
|
||||
{
|
||||
if (_pendingRevealCards.Remove(card))
|
||||
{
|
||||
// Add to owned inventory
|
||||
playerInventory.AddCard(card);
|
||||
|
||||
// Track as placed
|
||||
_placedInAlbumCardIds.Add(card.Id);
|
||||
|
||||
OnCardPlacedInAlbum?.Invoke(card);
|
||||
OnCardCollected?.Invoke(card);
|
||||
|
||||
Logging.Debug($"[CardSystemManager] Card '{card.Name}' placed in album and added to inventory.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Warning($"[CardSystemManager] Attempted to place card '{card.Name}' but it wasn't in pending reveal list.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a card has been placed in the album
|
||||
/// </summary>
|
||||
public bool IsCardPlacedInAlbum(string cardId)
|
||||
{
|
||||
return _placedInAlbumCardIds.Contains(cardId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets count of cards waiting to be revealed
|
||||
/// </summary>
|
||||
public int GetPendingRevealCount()
|
||||
{
|
||||
return _pendingRevealCards.Count;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Export current card collection to a serializable snapshot
|
||||
/// </summary>
|
||||
@@ -436,7 +614,9 @@ namespace Data.CardSystem
|
||||
var state = new CardCollectionState
|
||||
{
|
||||
boosterPackCount = playerInventory.BoosterPackCount,
|
||||
cards = new List<SavedCardEntry>()
|
||||
cards = new List<SavedCardEntry>(),
|
||||
pendingRevealCards = new List<SavedCardEntry>(),
|
||||
placedInAlbumCardIds = new List<string>(_placedInAlbumCardIds)
|
||||
};
|
||||
|
||||
foreach (var card in playerInventory.CollectedCards.Values)
|
||||
@@ -449,6 +629,18 @@ namespace Data.CardSystem
|
||||
copiesOwned = card.CopiesOwned
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var card in _pendingRevealCards)
|
||||
{
|
||||
if (string.IsNullOrEmpty(card.DefinitionId)) continue;
|
||||
state.pendingRevealCards.Add(new SavedCardEntry
|
||||
{
|
||||
definitionId = card.DefinitionId,
|
||||
rarity = card.Rarity,
|
||||
copiesOwned = card.CopiesOwned
|
||||
});
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -460,6 +652,9 @@ namespace Data.CardSystem
|
||||
if (state == null) return;
|
||||
|
||||
playerInventory.ClearAllCards();
|
||||
_pendingRevealCards.Clear();
|
||||
_placedInAlbumCardIds.Clear();
|
||||
|
||||
playerInventory.BoosterPackCount = state.boosterPackCount;
|
||||
OnBoosterCountChanged?.Invoke(playerInventory.BoosterPackCount);
|
||||
|
||||
@@ -479,6 +674,31 @@ namespace Data.CardSystem
|
||||
Logging.Warning($"[CardSystemManager] Saved card definition not found: {entry.definitionId}");
|
||||
}
|
||||
}
|
||||
|
||||
// Restore pending reveal cards
|
||||
if (state.pendingRevealCards != null)
|
||||
{
|
||||
foreach (var entry in state.pendingRevealCards)
|
||||
{
|
||||
if (string.IsNullOrEmpty(entry.definitionId)) continue;
|
||||
if (_definitionLookup.TryGetValue(entry.definitionId, out var def))
|
||||
{
|
||||
var cd = def.CreateCardData();
|
||||
cd.Rarity = entry.rarity;
|
||||
cd.CopiesOwned = entry.copiesOwned;
|
||||
_pendingRevealCards.Add(cd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Restore placed in album tracking
|
||||
if (state.placedInAlbumCardIds != null)
|
||||
{
|
||||
foreach (var cardId in state.placedInAlbumCardIds)
|
||||
{
|
||||
_placedInAlbumCardIds.Add(cardId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ISaveParticipant Implementation
|
||||
|
||||
@@ -31,6 +31,12 @@ namespace Levels
|
||||
/// Data for this level switch (target scene, icon, etc).
|
||||
/// </summary>
|
||||
public LevelSwitchData switchData;
|
||||
|
||||
/// <summary>
|
||||
/// If true, skip save/load logic and start the game active (unlocked by default)
|
||||
/// </summary>
|
||||
[SerializeField] private bool startUnlocked = false;
|
||||
|
||||
private SpriteRenderer iconRenderer;
|
||||
|
||||
// Settings reference
|
||||
@@ -52,6 +58,12 @@ namespace Levels
|
||||
if (iconRenderer == null)
|
||||
iconRenderer = GetComponent<SpriteRenderer>();
|
||||
|
||||
// If startUnlocked is true, set isUnlocked and skip save/load logic
|
||||
if (startUnlocked)
|
||||
{
|
||||
isUnlocked = true;
|
||||
}
|
||||
|
||||
// Initialize settings reference
|
||||
interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
ApplySwitchData();
|
||||
@@ -61,7 +73,14 @@ namespace Levels
|
||||
{
|
||||
base.Start(); // Register with save system
|
||||
|
||||
// If not restoring from save, start inactive
|
||||
// If startUnlocked is true, always start active
|
||||
if (startUnlocked)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, if not restoring from save, start inactive
|
||||
if (!IsRestoringFromSave && !isUnlocked)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
@@ -165,6 +184,10 @@ namespace Levels
|
||||
|
||||
protected override object GetSerializableState()
|
||||
{
|
||||
// Skip saving if startUnlocked is true
|
||||
if (startUnlocked)
|
||||
return null;
|
||||
|
||||
return new MinigameSwitchSaveData
|
||||
{
|
||||
isUnlocked = isUnlocked
|
||||
@@ -173,6 +196,10 @@ namespace Levels
|
||||
|
||||
protected override void ApplySerializableState(string serializedData)
|
||||
{
|
||||
// Skip loading if startUnlocked is true
|
||||
if (startUnlocked)
|
||||
return;
|
||||
|
||||
MinigameSwitchSaveData data = JsonUtility.FromJson<MinigameSwitchSaveData>(serializedData);
|
||||
if (data == null)
|
||||
{
|
||||
|
||||
192
Assets/Scripts/UI/CardSystem/AlbumCard.cs
Normal file
192
Assets/Scripts/UI/CardSystem/AlbumCard.cs
Normal file
@@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace UI.CardSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Album card component that wraps CardDisplay.
|
||||
/// Handles tap-to-enlarge and tap-to-shrink interactions for cards placed in album slots.
|
||||
///
|
||||
/// TODO: Consider refactoring to state machine pattern (PendingReveal, PlacedInSlot, Enlarged)
|
||||
/// This would eliminate the need for separate AlbumPlacementCard wrapper and simplify the hierarchy.
|
||||
/// See design discussion with state transitions for cleaner architecture.
|
||||
/// </summary>
|
||||
public class AlbumCard : MonoBehaviour, IPointerClickHandler
|
||||
{
|
||||
[Header("References")]
|
||||
[SerializeField] private CardDisplay cardDisplay;
|
||||
|
||||
[Header("Enlarge Settings")]
|
||||
[SerializeField] private float enlargedScale = 2.5f;
|
||||
[SerializeField] private float scaleDuration = 0.3f;
|
||||
|
||||
// Events for AlbumViewPage to manage backdrop and reparenting
|
||||
public event Action<AlbumCard> OnEnlargeRequested;
|
||||
public event Action<AlbumCard> OnShrinkRequested;
|
||||
|
||||
private AlbumCardSlot _parentSlot;
|
||||
private CardData _cardData;
|
||||
private bool _isEnlarged;
|
||||
private Vector3 _originalScale;
|
||||
private Transform _originalParent;
|
||||
private Vector3 _originalLocalPosition;
|
||||
private Quaternion _originalLocalRotation;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// Auto-find CardDisplay if not assigned
|
||||
if (cardDisplay == null)
|
||||
{
|
||||
cardDisplay = GetComponentInChildren<CardDisplay>();
|
||||
}
|
||||
|
||||
// Store original scale
|
||||
_originalScale = transform.localScale;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup card with data
|
||||
/// </summary>
|
||||
public void SetupCard(CardData data)
|
||||
{
|
||||
_cardData = data;
|
||||
|
||||
if (cardDisplay != null)
|
||||
{
|
||||
cardDisplay.SetupCard(data);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the parent slot this card belongs to
|
||||
/// </summary>
|
||||
public void SetParentSlot(AlbumCardSlot slot)
|
||||
{
|
||||
_parentSlot = slot;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the card data
|
||||
/// </summary>
|
||||
public CardData GetCardData()
|
||||
{
|
||||
return _cardData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle tap on card - request enlarge/shrink from parent page
|
||||
/// Only process clicks when card is placed in a slot (not during reveal flow)
|
||||
/// </summary>
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] OnPointerClick on {name}, _parentSlot={((_parentSlot != null) ? _parentSlot.name : "NULL")}, _isEnlarged={_isEnlarged}, position={eventData.position}");
|
||||
|
||||
// During reveal flow (before placed in slot), forward clicks to parent FlippableCard
|
||||
if (_parentSlot == null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - No parent slot, forwarding click to parent FlippableCard");
|
||||
|
||||
// Find parent FlippableCard and forward the click
|
||||
FlippableCard parentFlippable = GetComponentInParent<FlippableCard>();
|
||||
if (parentFlippable != null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Found parent FlippableCard, calling OnPointerClick");
|
||||
parentFlippable.OnPointerClick(eventData);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[CLICK-TRACE-ALBUMCARD] {name} - No parent FlippableCard found!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Has parent slot, processing click");
|
||||
|
||||
if (_isEnlarged)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Is enlarged, requesting shrink");
|
||||
OnShrinkRequested?.Invoke(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-ALBUMCARD] {name} - Is normal size, requesting enlarge");
|
||||
OnEnlargeRequested?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enlarge card (called by AlbumViewPage after reparenting)
|
||||
/// </summary>
|
||||
public void EnlargeCard()
|
||||
{
|
||||
if (_isEnlarged) return;
|
||||
|
||||
_isEnlarged = true;
|
||||
|
||||
// Store original transform info for restoration
|
||||
_originalParent = transform.parent;
|
||||
_originalLocalPosition = transform.localPosition;
|
||||
_originalLocalRotation = transform.localRotation;
|
||||
|
||||
// Scale up with snappy tween
|
||||
Tween.LocalScale(transform, _originalScale * enlargedScale, scaleDuration, 0f, Tween.EaseOutBack);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shrink card back to original size (called by AlbumViewPage before reparenting back)
|
||||
/// </summary>
|
||||
/// <param name="onComplete">Optional callback to invoke when shrink animation completes</param>
|
||||
public void ShrinkCard(System.Action onComplete = null)
|
||||
{
|
||||
if (!_isEnlarged) return;
|
||||
|
||||
_isEnlarged = false;
|
||||
|
||||
// Scale back down with snappy tween, invoke callback when done
|
||||
Tween.LocalScale(transform, _originalScale, scaleDuration, 0f, Tween.EaseInBack,
|
||||
completeCallback: () => onComplete?.Invoke());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get original parent for restoration
|
||||
/// </summary>
|
||||
public Transform GetOriginalParent()
|
||||
{
|
||||
return _originalParent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get original local position for restoration
|
||||
/// </summary>
|
||||
public Vector3 GetOriginalLocalPosition()
|
||||
{
|
||||
return _originalLocalPosition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get original local rotation for restoration
|
||||
/// </summary>
|
||||
public Quaternion GetOriginalLocalRotation()
|
||||
{
|
||||
return _originalLocalRotation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if card is currently enlarged
|
||||
/// </summary>
|
||||
public bool IsEnlarged => _isEnlarged;
|
||||
|
||||
/// <summary>
|
||||
/// Force reset enlarged state (for cleanup scenarios like page closing)
|
||||
/// </summary>
|
||||
public void ForceResetEnlargedState()
|
||||
{
|
||||
_isEnlarged = false;
|
||||
transform.localScale = _originalScale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3
Assets/Scripts/UI/CardSystem/AlbumCard.cs.meta
Normal file
3
Assets/Scripts/UI/CardSystem/AlbumCard.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 258a530448814715b5ec19737df2a658
|
||||
timeCreated: 1762505823
|
||||
@@ -1,7 +1,11 @@
|
||||
using Bootstrap;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Bootstrap;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UI.Core;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -18,11 +22,24 @@ namespace UI.CardSystem
|
||||
[SerializeField] private Button exitButton;
|
||||
[SerializeField] private BookCurlPro.BookPro book;
|
||||
|
||||
[Header("Zone Navigation")]
|
||||
[SerializeField] private BookTabButton[] zoneTabs; // All zone tab buttons
|
||||
|
||||
[Header("Album Card Reveal")]
|
||||
[SerializeField] private SlotContainer bottomRightSlots;
|
||||
[SerializeField] private GameObject albumCardPlacementPrefab; // The wrapper prefab with flip/drag (AlbumPlacementCard)
|
||||
|
||||
[Header("Card Enlarge System")]
|
||||
[SerializeField] private GameObject cardEnlargedBackdrop; // Backdrop to block interactions
|
||||
[SerializeField] private Transform cardEnlargedContainer; // Container for enlarged cards (sits above backdrop)
|
||||
|
||||
[Header("Booster Pack UI")]
|
||||
[SerializeField] private GameObject[] boosterPackButtons;
|
||||
[SerializeField] private BoosterOpeningPage boosterOpeningPage;
|
||||
|
||||
private Input.InputMode _previousInputMode;
|
||||
private List<AlbumCardPlacementDraggable> _activeCards = new List<AlbumCardPlacementDraggable>();
|
||||
private const int MAX_VISIBLE_CARDS = 3;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -32,6 +49,12 @@ namespace UI.CardSystem
|
||||
if (canvasGroup == null)
|
||||
canvasGroup = gameObject.AddComponent<CanvasGroup>();
|
||||
|
||||
// Hide backdrop initially
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(false);
|
||||
}
|
||||
|
||||
// Set up exit button
|
||||
if (exitButton != null)
|
||||
{
|
||||
@@ -54,6 +77,8 @@ namespace UI.CardSystem
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.OnBoosterCountChanged += OnBoosterCountChanged;
|
||||
// NOTE: OnPendingCardAdded is subscribed in TransitionIn, not here
|
||||
// This prevents spawning cards when page is not active
|
||||
|
||||
// Update initial button visibility
|
||||
int initialCount = CardSystemManager.Instance.GetBoosterPackCount();
|
||||
@@ -83,6 +108,7 @@ namespace UI.CardSystem
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.OnBoosterCountChanged -= OnBoosterCountChanged;
|
||||
// NOTE: OnPendingCardAdded is unsubscribed in TransitionOut
|
||||
}
|
||||
|
||||
// Clean up exit button
|
||||
@@ -105,6 +131,9 @@ namespace UI.CardSystem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up active cards
|
||||
CleanupActiveCards();
|
||||
}
|
||||
|
||||
private void OnExitButtonClicked()
|
||||
@@ -182,11 +211,26 @@ namespace UI.CardSystem
|
||||
Debug.Log("[AlbumViewPage] Switched to UI-only input mode on first entry");
|
||||
}
|
||||
|
||||
// Subscribe to pending card events while page is active
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.OnPendingCardAdded += OnPendingCardAdded;
|
||||
}
|
||||
|
||||
// Spawn pending cards when opening album
|
||||
SpawnPendingCards();
|
||||
|
||||
base.TransitionIn();
|
||||
}
|
||||
|
||||
public override void TransitionOut()
|
||||
{
|
||||
// Unsubscribe from pending card events when page closes
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.OnPendingCardAdded -= OnPendingCardAdded;
|
||||
}
|
||||
|
||||
// Don't restore input mode here - only restore when actually exiting (in OnExitButtonClicked)
|
||||
base.TransitionOut();
|
||||
}
|
||||
@@ -208,6 +252,9 @@ namespace UI.CardSystem
|
||||
|
||||
protected override void DoTransitionOut(System.Action onComplete)
|
||||
{
|
||||
// Clean up any enlarged card state before closing
|
||||
CleanupEnlargedCardState();
|
||||
|
||||
// Simple fade out animation
|
||||
if (canvasGroup != null)
|
||||
{
|
||||
@@ -219,5 +266,481 @@ namespace UI.CardSystem
|
||||
onComplete?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up enlarged card state when closing the album
|
||||
/// </summary>
|
||||
private void CleanupEnlargedCardState()
|
||||
{
|
||||
// Hide backdrop if visible
|
||||
if (cardEnlargedBackdrop != null && cardEnlargedBackdrop.activeSelf)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(false);
|
||||
}
|
||||
|
||||
// If there's an enlarged card in the container, return it to its slot
|
||||
if (cardEnlargedContainer != null && cardEnlargedContainer.childCount > 0)
|
||||
{
|
||||
// Get all enlarged cards (should only be one, but just in case)
|
||||
for (int i = cardEnlargedContainer.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
Transform cardTransform = cardEnlargedContainer.GetChild(i);
|
||||
AlbumCard albumCard = cardTransform.GetComponent<AlbumCard>();
|
||||
|
||||
if (albumCard != null && albumCard.IsEnlarged)
|
||||
{
|
||||
// Force reset state and return to slot
|
||||
Transform originalParent = albumCard.GetOriginalParent();
|
||||
if (originalParent != null)
|
||||
{
|
||||
cardTransform.SetParent(originalParent, true);
|
||||
cardTransform.localPosition = albumCard.GetOriginalLocalPosition();
|
||||
cardTransform.localRotation = albumCard.GetOriginalLocalRotation();
|
||||
}
|
||||
|
||||
albumCard.ForceResetEnlargedState();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Album Card Reveal System
|
||||
|
||||
/// <summary>
|
||||
/// Spawn pending cards from CardSystemManager
|
||||
/// Only spawns unique cards (one per definition+rarity, not one per copy)
|
||||
/// </summary>
|
||||
private void SpawnPendingCards()
|
||||
{
|
||||
if (CardSystemManager.Instance == null || bottomRightSlots == null || albumCardPlacementPrefab == null)
|
||||
return;
|
||||
|
||||
var pending = CardSystemManager.Instance.GetPendingRevealCards();
|
||||
|
||||
// Get unique cards only (by DefinitionId + Rarity)
|
||||
// Filter out cards with CopiesOwned = 0 (shouldn't happen but guard against it)
|
||||
var uniquePending = pending
|
||||
.Where(c => c.CopiesOwned > 0) // Guard: exclude zero-count cards
|
||||
.GroupBy(c => new { c.DefinitionId, c.Rarity })
|
||||
.Select(g => g.First()) // Take first instance of each unique card
|
||||
.ToList();
|
||||
|
||||
int spawnCount = Mathf.Min(uniquePending.Count, MAX_VISIBLE_CARDS);
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Spawning {spawnCount} unique pending cards (total pending: {pending.Count})");
|
||||
|
||||
for (int i = 0; i < spawnCount; i++)
|
||||
{
|
||||
SpawnCardInSlot(i, uniquePending[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawn a card in a specific slot
|
||||
/// </summary>
|
||||
private void SpawnCardInSlot(int slotIndex, CardData cardData)
|
||||
{
|
||||
// Guard: Don't spawn cards with zero copies
|
||||
if (cardData.CopiesOwned <= 0)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Skipping spawn of card '{cardData.Name}' with {cardData.CopiesOwned} copies");
|
||||
return;
|
||||
}
|
||||
|
||||
DraggableSlot slot = FindSlotByIndex(slotIndex);
|
||||
if (slot == null)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Could not find slot with SlotIndex {slotIndex}");
|
||||
return;
|
||||
}
|
||||
|
||||
// Instantiate card directly as child of the slot container (not the slot itself, not canvas root)
|
||||
// This keeps it in the correct UI hierarchy
|
||||
GameObject cardObj = Instantiate(albumCardPlacementPrefab, bottomRightSlots.transform);
|
||||
AlbumCardPlacementDraggable cardPlacement = cardObj.GetComponent<AlbumCardPlacementDraggable>();
|
||||
|
||||
if (cardPlacement != null)
|
||||
{
|
||||
// Setup card data
|
||||
cardPlacement.SetupCard(cardData);
|
||||
|
||||
// Subscribe to events
|
||||
cardPlacement.OnCardRevealed += OnCardRevealed;
|
||||
cardPlacement.OnCardPlacedInAlbum += OnCardPlacedInAlbum;
|
||||
|
||||
// NOW assign to slot - this will:
|
||||
// 1. Reparent to slot
|
||||
// 2. Apply slot's occupantSizeMode scaling
|
||||
// 3. Animate to slot position
|
||||
cardPlacement.AssignToSlot(slot, true);
|
||||
|
||||
// Track it
|
||||
_activeCards.Add(cardPlacement);
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Spawned card '{cardData.Name}' (CopiesOwned: {cardData.CopiesOwned}) in slot {slotIndex}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Spawned card has no AlbumCardDraggable component!");
|
||||
Destroy(cardObj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle when a new card is added to pending queue
|
||||
/// Only spawn if this unique card isn't already visualized
|
||||
/// </summary>
|
||||
private void OnPendingCardAdded(CardData card)
|
||||
{
|
||||
// Guard: Don't spawn cards with zero copies
|
||||
if (card.CopiesOwned <= 0)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumViewPage] Ignoring pending card '{card.Name}' with {card.CopiesOwned} copies");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we already have a card with this definition + rarity spawned
|
||||
bool alreadySpawned = _activeCards.Any(c =>
|
||||
c.CardData.DefinitionId == card.DefinitionId &&
|
||||
c.CardData.Rarity == card.Rarity);
|
||||
|
||||
if (alreadySpawned)
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card '{card.Name}' already spawned, skipping duplicate spawn");
|
||||
return; // Don't spawn duplicates
|
||||
}
|
||||
|
||||
// Try to spawn if we have space
|
||||
if (_activeCards.Count < MAX_VISIBLE_CARDS)
|
||||
{
|
||||
int nextSlotIndex = _activeCards.Count;
|
||||
SpawnCardInSlot(nextSlotIndex, card);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle when a card is revealed (flipped)
|
||||
/// </summary>
|
||||
private void OnCardRevealed(AlbumCardPlacementDraggable cardPlacement, CardData cardData)
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card revealed: {cardData.Name} (Zone: {cardData.Zone}, CopiesOwned: {cardData.CopiesOwned})");
|
||||
|
||||
// IMMEDIATELY move card from pending to inventory upon reveal
|
||||
if (CardSystemManager.Instance != null)
|
||||
{
|
||||
CardSystemManager.Instance.MarkCardAsPlaced(cardData);
|
||||
Debug.Log($"[AlbumViewPage] Moved card '{cardData.Name}' from pending to inventory on reveal");
|
||||
}
|
||||
|
||||
// Remove this card from active cards list
|
||||
_activeCards.Remove(cardPlacement);
|
||||
|
||||
// Check if we're currently viewing the correct zone for this card
|
||||
CardZone currentZone = GetCurrentZone();
|
||||
|
||||
if (currentZone != cardData.Zone)
|
||||
{
|
||||
// Card is from a different zone - navigate to its zone
|
||||
Debug.Log($"[AlbumViewPage] Card zone ({cardData.Zone}) doesn't match current zone ({currentZone}). Navigating to card's zone...");
|
||||
NavigateToZone(cardData.Zone);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card zone ({cardData.Zone}) matches current zone - no navigation needed.");
|
||||
}
|
||||
|
||||
// Shuffle remaining cards to front and spawn next unique card
|
||||
ShuffleCardsToFront();
|
||||
TrySpawnNextCard();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle when a card is placed in the album (from AlbumCardDraggable)
|
||||
/// Card data already moved to inventory in OnCardRevealed
|
||||
/// This just handles cleanup
|
||||
/// </summary>
|
||||
private void OnCardPlacedInAlbum(AlbumCardPlacementDraggable cardPlacement, CardData cardData)
|
||||
{
|
||||
Debug.Log($"[AlbumViewPage] Card placed in album slot: {cardData.Name}");
|
||||
|
||||
// Unsubscribe from events (card is now static in album)
|
||||
cardPlacement.OnCardRevealed -= OnCardRevealed;
|
||||
cardPlacement.OnCardPlacedInAlbum -= OnCardPlacedInAlbum;
|
||||
|
||||
// Note: Card already removed from _activeCards in OnCardRevealed
|
||||
// Note: Shuffle and spawn already done in OnCardRevealed
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuffle active cards to occupy front slots
|
||||
/// </summary>
|
||||
private void ShuffleCardsToFront()
|
||||
{
|
||||
if (bottomRightSlots == null || _activeCards.Count == 0)
|
||||
return;
|
||||
|
||||
// Convert to base DraggableObject list for helper method
|
||||
List<DraggableObject> draggableList = _activeCards.Cast<DraggableObject>().ToList();
|
||||
SlotContainerHelper.ShuffleToFront(bottomRightSlots, draggableList, animate: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to spawn the next pending card
|
||||
/// Only spawns unique cards (not duplicates)
|
||||
/// </summary>
|
||||
private void TrySpawnNextCard()
|
||||
{
|
||||
if (CardSystemManager.Instance == null)
|
||||
return;
|
||||
|
||||
if (_activeCards.Count >= MAX_VISIBLE_CARDS)
|
||||
return; // Already at max
|
||||
|
||||
var pending = CardSystemManager.Instance.GetPendingRevealCards();
|
||||
|
||||
// Get unique pending cards, excluding zero-count cards
|
||||
var uniquePending = pending
|
||||
.Where(c => c.CopiesOwned > 0) // Guard: exclude zero-count cards
|
||||
.GroupBy(c => new { c.DefinitionId, c.Rarity })
|
||||
.Select(g => g.First())
|
||||
.ToList();
|
||||
|
||||
// Find first unique card that's not already spawned
|
||||
foreach (var cardData in uniquePending)
|
||||
{
|
||||
bool alreadySpawned = _activeCards.Any(c =>
|
||||
c.CardData.DefinitionId == cardData.DefinitionId &&
|
||||
c.CardData.Rarity == cardData.Rarity);
|
||||
|
||||
if (!alreadySpawned)
|
||||
{
|
||||
int nextSlotIndex = _activeCards.Count;
|
||||
SpawnCardInSlot(nextSlotIndex, cardData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find a slot by its SlotIndex property
|
||||
/// </summary>
|
||||
private DraggableSlot FindSlotByIndex(int slotIndex)
|
||||
{
|
||||
if (bottomRightSlots == null)
|
||||
return null;
|
||||
|
||||
foreach (var slot in bottomRightSlots.Slots)
|
||||
{
|
||||
if (slot.SlotIndex == slotIndex)
|
||||
{
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current zone based on book page
|
||||
/// </summary>
|
||||
public CardZone GetCurrentZone()
|
||||
{
|
||||
if (book == null || zoneTabs == null || zoneTabs.Length == 0)
|
||||
return CardZone.AppleHills; // Default
|
||||
|
||||
int currentPage = book.CurrentPaper;
|
||||
|
||||
// Find tab with matching target page
|
||||
foreach (var tab in zoneTabs)
|
||||
{
|
||||
if (tab.TargetPage == currentPage)
|
||||
{
|
||||
return tab.Zone;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to first zone
|
||||
return zoneTabs[0].Zone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get tab for a specific zone
|
||||
/// </summary>
|
||||
public BookTabButton GetTabForZone(CardZone zone)
|
||||
{
|
||||
if (zoneTabs == null)
|
||||
return null;
|
||||
|
||||
foreach (var tab in zoneTabs)
|
||||
{
|
||||
if (tab.Zone == zone)
|
||||
{
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigate to a specific zone
|
||||
/// </summary>
|
||||
public void NavigateToZone(CardZone zone)
|
||||
{
|
||||
BookTabButton tab = GetTabForZone(zone);
|
||||
if (tab != null)
|
||||
{
|
||||
tab.ActivateTab();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up all active cards
|
||||
/// </summary>
|
||||
private void CleanupActiveCards()
|
||||
{
|
||||
foreach (var card in _activeCards)
|
||||
{
|
||||
if (card != null && card.gameObject != null)
|
||||
{
|
||||
card.OnCardRevealed -= OnCardRevealed;
|
||||
card.OnCardPlacedInAlbum -= OnCardPlacedInAlbum;
|
||||
Destroy(card.gameObject);
|
||||
}
|
||||
}
|
||||
_activeCards.Clear();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Card Enlarge System
|
||||
|
||||
/// <summary>
|
||||
/// Subscribe to album card events when a card is spawned in a slot
|
||||
/// Call this when AlbumCardSlot spawns a card
|
||||
/// </summary>
|
||||
public void RegisterAlbumCard(AlbumCard albumCard)
|
||||
{
|
||||
if (albumCard == null) return;
|
||||
|
||||
albumCard.OnEnlargeRequested += OnCardEnlargeRequested;
|
||||
albumCard.OnShrinkRequested += OnCardShrinkRequested;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unsubscribe from album card events
|
||||
/// </summary>
|
||||
public void UnregisterAlbumCard(AlbumCard albumCard)
|
||||
{
|
||||
if (albumCard == null) return;
|
||||
|
||||
albumCard.OnEnlargeRequested -= OnCardEnlargeRequested;
|
||||
albumCard.OnShrinkRequested -= OnCardShrinkRequested;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle card enlarge request - show backdrop and reparent card
|
||||
/// </summary>
|
||||
private void OnCardEnlargeRequested(AlbumCard card)
|
||||
{
|
||||
if (card == null) return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] OnCardEnlargeRequested called for card: {card.name}, current parent: {card.transform.parent.name}");
|
||||
|
||||
// IMPORTANT: Call EnlargeCard FIRST to store original parent (the slot)
|
||||
// BEFORE reparenting to the enlarged container
|
||||
card.EnlargeCard();
|
||||
|
||||
// Show backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(true);
|
||||
Debug.Log($"[AlbumViewPage] Backdrop shown");
|
||||
}
|
||||
|
||||
// NOW reparent card to enlarged container (above backdrop)
|
||||
if (cardEnlargedContainer != null)
|
||||
{
|
||||
card.transform.SetParent(cardEnlargedContainer, true);
|
||||
card.transform.SetAsLastSibling(); // Ensure on top
|
||||
Debug.Log($"[AlbumViewPage] Card reparented to enlarged container");
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Card enlarged: {card.GetCardData()?.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle card shrink request - hide backdrop and reparent card back to slot
|
||||
/// </summary>
|
||||
private void OnCardShrinkRequested(AlbumCard card)
|
||||
{
|
||||
if (card == null) return;
|
||||
|
||||
// Trigger shrink animation
|
||||
card.ShrinkCard();
|
||||
|
||||
// Hide backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(false);
|
||||
}
|
||||
|
||||
// Reparent back to original parent (the slot)
|
||||
Transform originalParent = card.GetOriginalParent();
|
||||
if (originalParent != null)
|
||||
{
|
||||
card.transform.SetParent(originalParent, true);
|
||||
card.transform.localPosition = card.GetOriginalLocalPosition();
|
||||
card.transform.localRotation = card.GetOriginalLocalRotation();
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumViewPage] Card shrunk: {card.GetCardData()?.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show backdrop and reparent slot preview card for enlargement
|
||||
/// </summary>
|
||||
public void ShowSlotPreview(AlbumCardSlot slot, Transform previewCardTransform)
|
||||
{
|
||||
if (previewCardTransform == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] ShowSlotPreview called for slot: {slot.name}");
|
||||
|
||||
// Show backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(true);
|
||||
}
|
||||
|
||||
// Reparent preview card to enlarged container (above backdrop)
|
||||
if (cardEnlargedContainer != null)
|
||||
{
|
||||
previewCardTransform.SetParent(cardEnlargedContainer, true);
|
||||
previewCardTransform.SetAsLastSibling();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide backdrop and trigger shrink animation for slot preview
|
||||
/// </summary>
|
||||
public void HideSlotPreview(AlbumCardSlot slot, Transform previewCardTransform, System.Action onComplete)
|
||||
{
|
||||
if (previewCardTransform == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] HideSlotPreview called for slot: {slot.name}");
|
||||
|
||||
// Hide backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(false);
|
||||
}
|
||||
|
||||
// Shrink preview card
|
||||
Vector3 originalScale = previewCardTransform.localScale / 2.5f; // Assuming 2.5x is enlarged scale
|
||||
Pixelplacement.Tween.LocalScale(previewCardTransform, originalScale, 0.3f, 0f, Pixelplacement.Tween.EaseInBack,
|
||||
completeCallback: () => onComplete?.Invoke());
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using BookCurlPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -18,6 +19,7 @@ namespace UI.CardSystem
|
||||
|
||||
[Header("Tab Configuration")]
|
||||
[SerializeField] private int targetPage;
|
||||
[SerializeField] private CardZone zone;
|
||||
|
||||
[Header("Visual Settings")]
|
||||
[SerializeField] private bool enableScaling = true;
|
||||
@@ -31,6 +33,10 @@ namespace UI.CardSystem
|
||||
|
||||
// Static dispatcher for coordinating all tabs
|
||||
private static event Action<BookTabButton> OnTabClicked;
|
||||
|
||||
// Public properties to access this tab's configuration
|
||||
public CardZone Zone => zone;
|
||||
public int TargetPage => targetPage;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace UI.CardSystem
|
||||
{
|
||||
[Header("UI References")]
|
||||
[SerializeField] private CanvasGroup canvasGroup;
|
||||
[SerializeField] private Button closeButton;
|
||||
|
||||
[Header("Booster Management")]
|
||||
[SerializeField] private GameObject boosterPackPrefab; // Prefab to instantiate new boosters
|
||||
@@ -58,23 +57,12 @@ namespace UI.CardSystem
|
||||
if (canvasGroup == null)
|
||||
canvasGroup = gameObject.AddComponent<CanvasGroup>();
|
||||
|
||||
// Set up close button
|
||||
if (closeButton != null)
|
||||
{
|
||||
closeButton.onClick.AddListener(OnCloseButtonClicked);
|
||||
}
|
||||
|
||||
// UI pages should start disabled
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (closeButton != null)
|
||||
{
|
||||
closeButton.onClick.RemoveListener(OnCloseButtonClicked);
|
||||
}
|
||||
|
||||
// Unsubscribe from slot events
|
||||
if (centerOpeningSlot != null)
|
||||
{
|
||||
@@ -86,14 +74,6 @@ namespace UI.CardSystem
|
||||
UnsubscribeFromAllBoosters();
|
||||
}
|
||||
|
||||
private void OnCloseButtonClicked()
|
||||
{
|
||||
if (UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PopPage();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the number of available booster packs before showing the page
|
||||
/// </summary>
|
||||
@@ -165,16 +145,10 @@ namespace UI.CardSystem
|
||||
/// </summary>
|
||||
private void SpawnBoosterInSlot(int slotIndex)
|
||||
{
|
||||
if (slotIndex >= bottomRightSlots.SlotCount)
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Slot index {slotIndex} out of range!");
|
||||
return;
|
||||
}
|
||||
|
||||
DraggableSlot slot = bottomRightSlots.GetSlotAtIndex(slotIndex);
|
||||
DraggableSlot slot = FindSlotByIndex(slotIndex);
|
||||
if (slot == null)
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Slot {slotIndex} is null!");
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Could not find slot with SlotIndex {slotIndex}!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -197,7 +171,7 @@ namespace UI.CardSystem
|
||||
// Track it
|
||||
_activeBoostersInSlots.Add(booster);
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Spawned booster in slot {slotIndex}");
|
||||
Debug.Log($"[BoosterOpeningPage] Spawned booster in slot with SlotIndex {slotIndex}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -260,6 +234,58 @@ namespace UI.CardSystem
|
||||
Debug.Log($"[BoosterOpeningPage] Updated visible boosters: {_activeBoostersInSlots.Count}/{targetCount}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuffle boosters so they always occupy the first available slots
|
||||
/// </summary>
|
||||
private void ShuffleBoostersToFront()
|
||||
{
|
||||
if (_activeBoostersInSlots.Count == 0) return;
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Shuffling {_activeBoostersInSlots.Count} boosters to front slots");
|
||||
|
||||
// Unassign all boosters from their current slots
|
||||
foreach (var booster in _activeBoostersInSlots)
|
||||
{
|
||||
if (booster.CurrentSlot != null)
|
||||
{
|
||||
booster.CurrentSlot.Vacate();
|
||||
}
|
||||
}
|
||||
|
||||
// Reassign boosters to first N slots starting from slot with SlotIndex 0
|
||||
for (int i = 0; i < _activeBoostersInSlots.Count; i++)
|
||||
{
|
||||
// Find slot by its actual SlotIndex property
|
||||
DraggableSlot targetSlot = FindSlotByIndex(i);
|
||||
BoosterPackDraggable booster = _activeBoostersInSlots[i];
|
||||
|
||||
if (targetSlot != null)
|
||||
{
|
||||
Debug.Log($"[BoosterOpeningPage] Assigning booster to slot with SlotIndex {i} {targetSlot.name}");
|
||||
booster.AssignToSlot(targetSlot, true); // Animate the move
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[BoosterOpeningPage] Could not find slot with SlotIndex {i} {targetSlot.name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find a slot by its SlotIndex property (not list position)
|
||||
/// </summary>
|
||||
private DraggableSlot FindSlotByIndex(int slotIndex)
|
||||
{
|
||||
foreach (var slot in bottomRightSlots.Slots)
|
||||
{
|
||||
if (slot.SlotIndex == slotIndex)
|
||||
{
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to spawn a new booster to maintain up to 3 visible
|
||||
/// Pass decrementCount=true when called after placing a booster in center slot
|
||||
@@ -278,14 +304,14 @@ namespace UI.CardSystem
|
||||
if (_activeBoostersInSlots.Count >= effectiveCount)
|
||||
return; // No more boosters available
|
||||
|
||||
// Find first available slot
|
||||
// Find first available slot by SlotIndex (0, 1, 2)
|
||||
for (int i = 0; i < MAX_VISIBLE_BOOSTERS; i++)
|
||||
{
|
||||
DraggableSlot slot = bottomRightSlots.GetSlotAtIndex(i);
|
||||
DraggableSlot slot = FindSlotByIndex(i);
|
||||
if (slot != null && !slot.IsOccupied)
|
||||
{
|
||||
SpawnBoosterInSlot(i);
|
||||
Debug.Log($"[BoosterOpeningPage] Spawned new booster in slot {i}");
|
||||
Debug.Log($"[BoosterOpeningPage] Spawned new booster in slot with SlotIndex {i}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -322,6 +348,9 @@ namespace UI.CardSystem
|
||||
// Use decrementCount=true because this booster will be consumed
|
||||
TrySpawnNewBooster(decrementCount: true);
|
||||
|
||||
// Shuffle remaining boosters to occupy the first slots
|
||||
ShuffleBoostersToFront();
|
||||
|
||||
Debug.Log($"[BoosterOpeningPage] Booster placed in center, ready for taps. Active boosters in slots: {_activeBoostersInSlots.Count}");
|
||||
}
|
||||
|
||||
@@ -442,12 +471,17 @@ namespace UI.CardSystem
|
||||
SpawnCardBacks(_currentCardData.Length);
|
||||
|
||||
// Wait for player to reveal all cards
|
||||
bool isLastBooster = _availableBoosterCount <= 0;
|
||||
yield return StartCoroutine(WaitForCardReveals());
|
||||
|
||||
if (_availableBoosterCount <= 0)
|
||||
// Check if this was the last booster pack
|
||||
if (isLastBooster)
|
||||
{
|
||||
// No more boosters, auto-close page
|
||||
yield return new WaitForSeconds(1f);
|
||||
// Wait for all card animations to complete before transitioning
|
||||
// WaitForCardReveals already includes: 0.5s wait + (cardCount * 0.5s stagger) + 0.5s animation + 0.5s final
|
||||
// Total is: 1.5s + (cardCount * 0.5s)
|
||||
// For 5 cards that's 4 seconds total, which should be enough
|
||||
Debug.Log("[BoosterOpeningPage] Last booster opened, auto-transitioning to album main page");
|
||||
if (UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PopPage();
|
||||
@@ -753,9 +787,14 @@ namespace UI.CardSystem
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for all animations to complete
|
||||
// Last card starts at: (cardCount - 1) * 0.5s delay
|
||||
// Last card finishes at: (cardCount - 1) * 0.5s + 0.5s animation duration = cardCount * 0.5s
|
||||
float totalAnimationTime = _currentCardData.Length * 0.5f;
|
||||
|
||||
_currentRevealedCards.Clear();
|
||||
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
yield return new WaitForSeconds(totalAnimationTime);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace UI.CardSystem
|
||||
[Header("References")]
|
||||
[SerializeField] private Button openAlbumButton;
|
||||
[SerializeField] private AlbumViewPage albumViewPage;
|
||||
[SerializeField] private BoosterOpeningPage boosterOpeningPage;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -48,24 +49,41 @@ namespace UI.CardSystem
|
||||
|
||||
private void OnOpenAlbumClicked()
|
||||
{
|
||||
if (openAlbumButton != null)
|
||||
if (UIPageController.Instance == null) return;
|
||||
|
||||
// Check if we're currently on the booster opening page
|
||||
if (UIPageController.Instance.CurrentPage == boosterOpeningPage)
|
||||
{
|
||||
openAlbumButton.gameObject.SetActive(false);
|
||||
// We're in booster opening page, pop back to album main page
|
||||
UIPageController.Instance.PopPage();
|
||||
}
|
||||
else if (UIPageController.Instance.CurrentPage != albumViewPage)
|
||||
{
|
||||
// We're not in the album at all, open it
|
||||
if (openAlbumButton != null)
|
||||
{
|
||||
openAlbumButton.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if (albumViewPage != null && UIPageController.Instance != null)
|
||||
{
|
||||
UIPageController.Instance.PushPage(albumViewPage);
|
||||
if (albumViewPage != null)
|
||||
{
|
||||
UIPageController.Instance.PushPage(albumViewPage);
|
||||
}
|
||||
}
|
||||
// If we're already on the album main page, do nothing
|
||||
}
|
||||
|
||||
private void OnPageChanged(UIPage currentPage)
|
||||
{
|
||||
// If the album page is no longer active, show the button again
|
||||
if (currentPage != albumViewPage && openAlbumButton != null)
|
||||
{
|
||||
openAlbumButton.gameObject.SetActive(true);
|
||||
}
|
||||
if (openAlbumButton == null) return;
|
||||
|
||||
// Show the button when:
|
||||
// 1. We're on the booster opening page (acts as "back to album" button)
|
||||
// 2. We're NOT on the album main page (acts as "open album" button)
|
||||
// Hide the button only when we're on the album main page
|
||||
|
||||
bool shouldShowButton = currentPage == boosterOpeningPage || currentPage != albumViewPage;
|
||||
openAlbumButton.gameObject.SetActive(shouldShowButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using Core;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
@@ -13,7 +14,7 @@ namespace UI.CardSystem
|
||||
/// <summary>
|
||||
/// Displays a single card using the new visual system with frames, overlays, backgrounds, and zone shapes.
|
||||
/// </summary>
|
||||
public class CardDisplay : MonoBehaviour
|
||||
public class CardDisplay : MonoBehaviour, IPointerClickHandler
|
||||
{
|
||||
[Header("UI Elements")]
|
||||
[SerializeField] private TextMeshProUGUI cardNameText;
|
||||
@@ -36,6 +37,10 @@ namespace UI.CardSystem
|
||||
|
||||
// Events
|
||||
public event Action<CardDisplay> OnCardClicked;
|
||||
|
||||
// Preview mode tracking for click forwarding
|
||||
private bool _isPreviewMode;
|
||||
private AlbumCardSlot _previewSlot;
|
||||
|
||||
/// <summary>
|
||||
/// Sets up the card display with the given card data
|
||||
@@ -82,6 +87,47 @@ namespace UI.CardSystem
|
||||
|
||||
Logging.Debug($"[CardDisplay] Updated visuals for card: {cardData.Name} (Rarity: {cardData.Rarity}, Zone: {cardData.Zone})");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply preview visuals - black tint to card image and question marks for name
|
||||
/// Used for empty slot previews to show locked/unknown cards
|
||||
/// </summary>
|
||||
public void SetPreviewVisuals()
|
||||
{
|
||||
// Set card name to question marks
|
||||
if (cardNameText != null)
|
||||
{
|
||||
cardNameText.text = "??????";
|
||||
}
|
||||
|
||||
// Apply black non-opaque tint to card image
|
||||
if (cardImage != null)
|
||||
{
|
||||
cardImage.color = Color.black;
|
||||
}
|
||||
|
||||
Logging.Debug($"[CardDisplay] Applied preview visuals (black tint and ?????? name)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset preview visuals back to normal
|
||||
/// </summary>
|
||||
public void ClearPreviewVisuals()
|
||||
{
|
||||
// Restore normal card name
|
||||
if (cardData != null && cardNameText != null)
|
||||
{
|
||||
cardNameText.text = cardData.Name ?? "Unknown Card";
|
||||
}
|
||||
|
||||
// Reset card image color to white (normal)
|
||||
if (cardImage != null)
|
||||
{
|
||||
cardImage.color = Color.white;
|
||||
}
|
||||
|
||||
Logging.Debug($"[CardDisplay] Cleared preview visuals");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the card name text
|
||||
@@ -234,32 +280,76 @@ namespace UI.CardSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable preview mode - when clicked, forwards click to the associated slot
|
||||
/// </summary>
|
||||
public void SetPreviewMode(bool isEnabled, AlbumCardSlot slot = null)
|
||||
{
|
||||
_isPreviewMode = isEnabled;
|
||||
_previewSlot = slot;
|
||||
|
||||
// Enable raycast targets on images so this CardDisplay can receive clicks
|
||||
if (cardImage != null) cardImage.raycastTarget = isEnabled;
|
||||
if (frameImage != null) frameImage.raycastTarget = isEnabled;
|
||||
if (overlayImage != null) overlayImage.raycastTarget = isEnabled;
|
||||
if (backgroundImage != null) backgroundImage.raycastTarget = isEnabled;
|
||||
if (zoneShapeImage != null) zoneShapeImage.raycastTarget = isEnabled;
|
||||
|
||||
Logging.Debug($"[CardDisplay] Preview mode {(isEnabled ? "enabled" : "disabled")}, slot: {(slot != null ? slot.name : "NULL")}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle click on CardDisplay - forward to preview slot if in preview mode
|
||||
/// </summary>
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Logging.Debug($"[CLICK-TRACE-CARDDISPLAY] OnPointerClick on {name}, _isPreviewMode={_isPreviewMode}, _previewSlot={((_previewSlot != null) ? _previewSlot.name : "NULL")}");
|
||||
|
||||
if (_isPreviewMode && _previewSlot != null)
|
||||
{
|
||||
Logging.Debug($"[CLICK-TRACE-CARDDISPLAY] {name} - In preview mode, calling DismissPreview on slot: {_previewSlot.name}");
|
||||
_previewSlot.DismissPreview();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not in preview mode - forward click to parent AlbumCard (if it exists)
|
||||
AlbumCard parentAlbumCard = GetComponentInParent<AlbumCard>();
|
||||
if (parentAlbumCard != null)
|
||||
{
|
||||
Logging.Debug($"[CLICK-TRACE-CARDDISPLAY] {name} - Forwarding click to parent AlbumCard");
|
||||
parentAlbumCard.OnPointerClick(eventData);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Debug($"[CLICK-TRACE-CARDDISPLAY] {name} - No parent AlbumCard, firing OnCardClicked event");
|
||||
OnCardClicked?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
/// <summary>
|
||||
/// Editor-only: Creates card data from the assigned definition and displays it
|
||||
/// Editor-only: Preview a card from the assigned definition
|
||||
/// </summary>
|
||||
public void PreviewFromDefinition()
|
||||
{
|
||||
if (editorCardDefinition == null)
|
||||
{
|
||||
Logging.Warning("[CardDisplay] Cannot preview: No card definition assigned in editor");
|
||||
UnityEngine.Debug.LogWarning("[CardDisplay] No Card Definition assigned in Editor Tools.");
|
||||
return;
|
||||
}
|
||||
|
||||
cardData = editorCardDefinition.CreateCardData();
|
||||
UpdateCardVisuals();
|
||||
|
||||
Logging.Debug($"[CardDisplay] Previewing card from definition: {cardData.Name}");
|
||||
CardData previewData = editorCardDefinition.CreateCardData();
|
||||
SetupCard(previewData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Editor-only: Clears the preview
|
||||
/// Editor-only: Clear the preview
|
||||
/// </summary>
|
||||
public void ClearPreview()
|
||||
{
|
||||
cardData = null;
|
||||
ClearCard();
|
||||
Logging.Debug("[CardDisplay] Preview cleared");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -300,4 +390,3 @@ namespace UI.CardSystem
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Data.CardSystem;
|
||||
using Pixelplacement;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI.CardSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Draggable card for album reveal system.
|
||||
/// Handles both tap and drag-hold interactions for revealing cards.
|
||||
/// Auto-snaps to matching album slot on release/tap.
|
||||
/// </summary>
|
||||
public class AlbumCardPlacementDraggable : DraggableObject
|
||||
{
|
||||
[Header("Album Card Settings")]
|
||||
[SerializeField] private FlippableCard flippableCard;
|
||||
[SerializeField] private float holdRevealDelay = 0.1f;
|
||||
|
||||
private CardData _cardData;
|
||||
private bool _isRevealed = false;
|
||||
private bool _isDragRevealing = false;
|
||||
private bool _waitingForPlacementTap = false;
|
||||
private Coroutine _holdRevealCoroutine;
|
||||
private bool _isHolding = false; // Track if pointer is currently down
|
||||
|
||||
// Events
|
||||
public event Action<AlbumCardPlacementDraggable, CardData> OnCardRevealed;
|
||||
public event Action<AlbumCardPlacementDraggable, CardData> OnCardPlacedInAlbum;
|
||||
|
||||
public CardData CardData => _cardData;
|
||||
public bool IsRevealed => _isRevealed;
|
||||
public CardZone Zone => _cardData?.Zone ?? CardZone.AppleHills;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
// Auto-find FlippableCard if not assigned
|
||||
if (flippableCard == null)
|
||||
{
|
||||
flippableCard = GetComponent<FlippableCard>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the card data (stores it but doesn't reveal until tapped/dragged)
|
||||
/// </summary>
|
||||
public void SetupCard(CardData data)
|
||||
{
|
||||
_cardData = data;
|
||||
|
||||
if (flippableCard != null)
|
||||
{
|
||||
flippableCard.SetupCard(data);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reveal the card (flip to show front)
|
||||
/// </summary>
|
||||
public void RevealCard()
|
||||
{
|
||||
if (_isRevealed) return;
|
||||
|
||||
_isRevealed = true;
|
||||
|
||||
if (flippableCard != null)
|
||||
{
|
||||
flippableCard.FlipToReveal();
|
||||
}
|
||||
|
||||
OnCardRevealed?.Invoke(this, _cardData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Snap to the matching album slot
|
||||
/// </summary>
|
||||
public void SnapToAlbumSlot()
|
||||
{
|
||||
if (_cardData == null)
|
||||
{
|
||||
Debug.LogWarning("[AlbumCardPlacementDraggable] Cannot snap to slot - no card data assigned.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Find all album card slots in the scene
|
||||
AlbumCardSlot[] allSlots = FindObjectsByType<AlbumCardSlot>(FindObjectsSortMode.None);
|
||||
|
||||
AlbumCardSlot matchingSlot = null;
|
||||
foreach (var slot in allSlots)
|
||||
{
|
||||
if (slot.CanAcceptCard(_cardData))
|
||||
{
|
||||
matchingSlot = slot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchingSlot != null)
|
||||
{
|
||||
SetDraggingEnabled(false);
|
||||
|
||||
// NEW FLOW: Extract AlbumCard FIRST, then tween it
|
||||
if (flippableCard != null)
|
||||
{
|
||||
AlbumCard extractedCard = flippableCard.ExtractAlbumCard(matchingSlot.transform);
|
||||
|
||||
if (extractedCard != null)
|
||||
{
|
||||
// Notify slot that card was placed
|
||||
matchingSlot.OnCardPlaced(extractedCard);
|
||||
|
||||
// NOW tween the extracted AlbumCard into position
|
||||
TweenExtractedCardToSlot(extractedCard, () =>
|
||||
{
|
||||
// After animation completes
|
||||
Debug.Log($"[AlbumCardPlacementDraggable] Card placement animation complete for {_cardData.Name}");
|
||||
|
||||
// Notify that card was placed
|
||||
OnCardPlacedInAlbum?.Invoke(this, _cardData);
|
||||
|
||||
// Destroy this wrapper (the AlbumPlacementCard)
|
||||
Destroy(gameObject);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[AlbumCardPlacementDraggable] Failed to extract AlbumCard from wrapper!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AlbumCardPlacementDraggable] Could not find matching slot for card '{_cardData.Name}' (Zone: {_cardData.Zone}, Index: {_cardData.CollectionIndex})");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tween the extracted AlbumCard into its slot position
|
||||
/// Tweens from current size to slot size - AspectRatioFitter handles width
|
||||
/// </summary>
|
||||
private void TweenExtractedCardToSlot(AlbumCard card, System.Action onComplete)
|
||||
{
|
||||
Transform cardTransform = card.transform;
|
||||
RectTransform cardRect = cardTransform as RectTransform;
|
||||
|
||||
if (cardRect != null)
|
||||
{
|
||||
// Get target height from slot
|
||||
RectTransform slotRect = cardTransform.parent as RectTransform;
|
||||
float targetHeight = slotRect != null ? slotRect.rect.height : cardRect.sizeDelta.y;
|
||||
|
||||
// Tween from current size to target size (AspectRatioFitter will adjust width)
|
||||
Vector2 targetSize = new Vector2(cardRect.sizeDelta.x, targetHeight);
|
||||
Tween.Size(cardRect, targetSize, snapDuration, 0f, Tween.EaseOutBack);
|
||||
|
||||
// Tween position and rotation to slot center
|
||||
Tween.LocalPosition(cardRect, Vector3.zero, snapDuration, 0f, Tween.EaseOutBack);
|
||||
Tween.LocalRotation(cardTransform, Quaternion.identity, snapDuration, 0f, Tween.EaseOutBack,
|
||||
completeCallback: () =>
|
||||
{
|
||||
Debug.Log($"[AlbumCardPlacementDraggable] Tween complete for extracted card {card.name}, final height: {cardRect.sizeDelta.y}");
|
||||
onComplete?.Invoke();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// No RectTransform, just reset and call callback
|
||||
cardTransform.localPosition = Vector3.zero;
|
||||
cardTransform.localRotation = Quaternion.identity;
|
||||
onComplete?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPointerDownHook()
|
||||
{
|
||||
base.OnPointerDownHook();
|
||||
|
||||
_isHolding = true;
|
||||
|
||||
// Start hold-reveal timer if card not yet revealed
|
||||
if (!_isRevealed && _holdRevealCoroutine == null)
|
||||
{
|
||||
_holdRevealCoroutine = StartCoroutine(HoldRevealTimer());
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPointerUpHook(bool longPress)
|
||||
{
|
||||
base.OnPointerUpHook(longPress);
|
||||
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] OnPointerUpHook on {name}, _wasDragged={_wasDragged}, _isRevealed={_isRevealed}, _waitingForPlacementTap={_waitingForPlacementTap}, longPress={longPress}");
|
||||
|
||||
_isHolding = false;
|
||||
|
||||
// Cancel hold timer if running
|
||||
if (_holdRevealCoroutine != null)
|
||||
{
|
||||
StopCoroutine(_holdRevealCoroutine);
|
||||
_holdRevealCoroutine = null;
|
||||
}
|
||||
|
||||
// Handle tap (not dragged)
|
||||
if (!_wasDragged)
|
||||
{
|
||||
if (!_isRevealed)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - First tap, revealing card");
|
||||
// First tap: reveal the card
|
||||
RevealCard();
|
||||
_waitingForPlacementTap = true;
|
||||
}
|
||||
else if (_waitingForPlacementTap)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Second tap, snapping to slot");
|
||||
// Second tap: snap to slot
|
||||
_waitingForPlacementTap = false;
|
||||
SnapToAlbumSlot();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Tap after reveal but not waiting for placement tap");
|
||||
}
|
||||
}
|
||||
else if (_isDragRevealing)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Was drag-revealed, auto-snapping");
|
||||
// Was drag-revealed, auto-snap on release
|
||||
_isDragRevealing = false;
|
||||
SnapToAlbumSlot();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-PLACEMENT] {name} - Was dragged but no special handling");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Coroutine to reveal card after holding for specified duration
|
||||
/// </summary>
|
||||
private IEnumerator HoldRevealTimer()
|
||||
{
|
||||
yield return new WaitForSeconds(holdRevealDelay);
|
||||
|
||||
// If still holding after delay, reveal the card
|
||||
if (!_isRevealed && _isHolding)
|
||||
{
|
||||
RevealCard();
|
||||
_isDragRevealing = true;
|
||||
Debug.Log("[AlbumCardDraggable] Card revealed via hold");
|
||||
}
|
||||
|
||||
_holdRevealCoroutine = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 706803638ea24880bae19c87d3851ce6
|
||||
timeCreated: 1762470947
|
||||
351
Assets/Scripts/UI/CardSystem/DragDrop/AlbumCardSlot.cs
Normal file
351
Assets/Scripts/UI/CardSystem/DragDrop/AlbumCardSlot.cs
Normal file
@@ -0,0 +1,351 @@
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Data.CardSystem;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace UI.CardSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Specialized slot for album pages that only accepts a specific card.
|
||||
/// Validates cards based on their CardDefinition.
|
||||
/// Self-populates with owned cards when enabled.
|
||||
/// Shows preview of target card when empty slot is tapped.
|
||||
/// </summary>
|
||||
public class AlbumCardSlot : DraggableSlot, IPointerClickHandler
|
||||
{
|
||||
[Header("Album Slot Configuration")]
|
||||
[SerializeField] private CardDefinition targetCardDefinition; // Which card this slot accepts
|
||||
[SerializeField] private GameObject albumCardPrefab; // Prefab to spawn when card is owned
|
||||
|
||||
[Header("Preview Card (for empty slots)")]
|
||||
[SerializeField] private CardDisplay previewCardDisplay; // Nested CardDisplay showing greyed-out preview
|
||||
[SerializeField] private float previewEnlargedScale = 2.5f;
|
||||
[SerializeField] private float previewScaleDuration = 0.3f;
|
||||
|
||||
private bool _isOccupiedPermanently = false;
|
||||
private AlbumCard _placedCard;
|
||||
private bool _isPreviewShowing = false;
|
||||
private Vector3 _previewOriginalScale;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// Store original scale of preview card
|
||||
if (previewCardDisplay != null)
|
||||
{
|
||||
_previewOriginalScale = previewCardDisplay.transform.localScale;
|
||||
// Hide preview card by default
|
||||
previewCardDisplay.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the target card this slot should accept
|
||||
/// </summary>
|
||||
public void SetTargetCard(CardDefinition definition)
|
||||
{
|
||||
targetCardDefinition = definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if this slot can accept a specific card
|
||||
/// </summary>
|
||||
public bool CanAcceptCard(CardData cardData)
|
||||
{
|
||||
if (cardData == null || targetCardDefinition == null) return false;
|
||||
if (_isOccupiedPermanently) return false;
|
||||
|
||||
// Card must match this slot's target definition
|
||||
return cardData.DefinitionId == targetCardDefinition.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a card is successfully placed in this slot
|
||||
/// </summary>
|
||||
public void OnCardPlaced(AlbumCard albumCard = null)
|
||||
{
|
||||
_isOccupiedPermanently = true;
|
||||
|
||||
if (albumCard != null)
|
||||
{
|
||||
_placedCard = albumCard;
|
||||
albumCard.SetParentSlot(this);
|
||||
|
||||
// Register with AlbumViewPage for enlarge/shrink handling
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.RegisterAlbumCard(albumCard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if this slot has a placed card
|
||||
/// </summary>
|
||||
public bool HasPlacedCard()
|
||||
{
|
||||
return _placedCard != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the placed card (if any)
|
||||
/// </summary>
|
||||
public AlbumCard GetPlacedCard()
|
||||
{
|
||||
return _placedCard;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// Check if we should spawn a card for this slot
|
||||
CheckAndSpawnOwnedCard();
|
||||
|
||||
// Setup preview card display if slot is empty
|
||||
SetupPreviewCard();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup the preview card display to show target card with preview visuals
|
||||
/// Preview stays hidden until user taps to show it
|
||||
/// </summary>
|
||||
private void SetupPreviewCard()
|
||||
{
|
||||
if (previewCardDisplay == null || targetCardDefinition == null)
|
||||
return;
|
||||
|
||||
// Only setup preview if slot is empty
|
||||
if (_isOccupiedPermanently || _placedCard != null)
|
||||
{
|
||||
// Hide preview if slot is occupied
|
||||
previewCardDisplay.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Setup preview card data
|
||||
CardData previewData = targetCardDefinition.CreateCardData();
|
||||
previewData.Rarity = CardRarity.Normal; // Show as normal rarity
|
||||
previewCardDisplay.SetupCard(previewData);
|
||||
|
||||
// Apply preview visuals (black tint and ?????? name)
|
||||
previewCardDisplay.SetPreviewVisuals();
|
||||
|
||||
// Keep preview hidden - it'll show when user taps to enlarge
|
||||
previewCardDisplay.gameObject.SetActive(false);
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Setup preview card for {targetCardDefinition.Name} (hidden until tap)");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if player owns the card for this slot and spawn it if so
|
||||
/// </summary>
|
||||
private void CheckAndSpawnOwnedCard()
|
||||
{
|
||||
// Guard: need CardSystemManager and target definition
|
||||
if (CardSystemManager.Instance == null || targetCardDefinition == null)
|
||||
return;
|
||||
|
||||
// Guard: don't spawn if already occupied
|
||||
if (_isOccupiedPermanently || _placedCard != null)
|
||||
return;
|
||||
|
||||
// Guard: need prefab to spawn
|
||||
if (albumCardPrefab == null)
|
||||
{
|
||||
Debug.LogWarning($"[AlbumCardSlot] No albumCardPrefab assigned for slot targeting {targetCardDefinition.name}");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if player owns this card at ANY rarity (prioritize highest rarity)
|
||||
CardData ownedCard = null;
|
||||
|
||||
// Check in order: Legendary > Rare > Normal
|
||||
foreach (CardRarity rarity in new[] { CardRarity.Legendary, CardRarity.Rare, CardRarity.Normal })
|
||||
{
|
||||
CardData card = CardSystemManager.Instance.GetCardInventory().GetCard(targetCardDefinition.Id, rarity);
|
||||
if (card != null)
|
||||
{
|
||||
ownedCard = card;
|
||||
break; // Found highest rarity owned
|
||||
}
|
||||
}
|
||||
|
||||
// Spawn card if owned
|
||||
if (ownedCard != null)
|
||||
{
|
||||
SpawnAlbumCard(ownedCard);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawn an AlbumCard in this slot
|
||||
/// </summary>
|
||||
private void SpawnAlbumCard(CardData cardData)
|
||||
{
|
||||
GameObject cardObj = Instantiate(albumCardPrefab, transform);
|
||||
AlbumCard albumCard = cardObj.GetComponent<AlbumCard>();
|
||||
|
||||
if (albumCard != null)
|
||||
{
|
||||
albumCard.SetupCard(cardData);
|
||||
albumCard.SetParentSlot(this);
|
||||
_placedCard = albumCard;
|
||||
_isOccupiedPermanently = true;
|
||||
|
||||
// Register with AlbumViewPage for enlarge/shrink handling
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.RegisterAlbumCard(albumCard);
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Spawned owned card '{cardData.Name}' ({cardData.Rarity}) in slot");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[AlbumCardSlot] Spawned prefab has no AlbumCard component!");
|
||||
Destroy(cardObj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the target card definition for this slot
|
||||
/// </summary>
|
||||
public CardDefinition GetTargetCardDefinition()
|
||||
{
|
||||
return targetCardDefinition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle click on slot - show/hide preview if empty
|
||||
/// </summary>
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] OnPointerClick on {name}, _isOccupiedPermanently={_isOccupiedPermanently}, _placedCard={((_placedCard != null) ? _placedCard.name : "NULL")}, _isPreviewShowing={_isPreviewShowing}, position={eventData.position}");
|
||||
|
||||
// Only handle clicks if slot is empty
|
||||
if (_isOccupiedPermanently || _placedCard != null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - Slot is occupied, ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
// Only handle if we have a preview card setup
|
||||
if (previewCardDisplay == null || targetCardDefinition == null)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - No preview setup, ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isPreviewShowing)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - Preview is showing, hiding it");
|
||||
HidePreview();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] {name} - Preview is hidden, showing it");
|
||||
ShowPreview();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show enlarged preview of target card
|
||||
/// </summary>
|
||||
private void ShowPreview()
|
||||
{
|
||||
if (_isPreviewShowing || previewCardDisplay == null)
|
||||
return;
|
||||
|
||||
_isPreviewShowing = true;
|
||||
|
||||
// Show the preview card (already has preview visuals applied)
|
||||
previewCardDisplay.gameObject.SetActive(true);
|
||||
|
||||
// Enable preview mode so clicks on CardDisplay forward to this slot
|
||||
previewCardDisplay.SetPreviewMode(true, this);
|
||||
|
||||
// Reset to normal scale before enlarging
|
||||
previewCardDisplay.transform.localScale = _previewOriginalScale;
|
||||
|
||||
// Get AlbumViewPage to show backdrop and reparent
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.ShowSlotPreview(this, previewCardDisplay.transform);
|
||||
}
|
||||
|
||||
// Scale up preview card
|
||||
Pixelplacement.Tween.LocalScale(previewCardDisplay.transform, _previewOriginalScale * previewEnlargedScale,
|
||||
previewScaleDuration, 0f, Pixelplacement.Tween.EaseOutBack);
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Showing preview for {targetCardDefinition.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide preview and return to normal
|
||||
/// </summary>
|
||||
private void HidePreview()
|
||||
{
|
||||
if (!_isPreviewShowing || previewCardDisplay == null)
|
||||
return;
|
||||
|
||||
_isPreviewShowing = false;
|
||||
|
||||
// Disable preview mode on CardDisplay
|
||||
previewCardDisplay.SetPreviewMode(false, null);
|
||||
|
||||
// Get AlbumViewPage to hide backdrop
|
||||
AlbumViewPage albumPage = FindObjectOfType<AlbumViewPage>();
|
||||
if (albumPage != null)
|
||||
{
|
||||
albumPage.HideSlotPreview(this, previewCardDisplay.transform, () =>
|
||||
{
|
||||
// After shrink completes, reparent back to slot
|
||||
previewCardDisplay.transform.SetParent(transform, false);
|
||||
|
||||
// Reset RectTransform properties
|
||||
RectTransform previewRect = previewCardDisplay.transform as RectTransform;
|
||||
if (previewRect != null)
|
||||
{
|
||||
// Set anchors to stretch in all directions (matching original setup)
|
||||
previewRect.anchorMin = Vector2.zero; // (0, 0)
|
||||
previewRect.anchorMax = Vector2.one; // (1, 1)
|
||||
|
||||
// Reset offsets to zero (left, right, top, bottom all = 0)
|
||||
previewRect.offsetMin = Vector2.zero; // Sets left and bottom to 0
|
||||
previewRect.offsetMax = Vector2.zero; // Sets right and top to 0 (note: these are negative values internally)
|
||||
|
||||
previewRect.pivot = new Vector2(0.5f, 0.5f);
|
||||
}
|
||||
|
||||
previewCardDisplay.transform.localPosition = Vector3.zero;
|
||||
previewCardDisplay.transform.localRotation = Quaternion.identity;
|
||||
previewCardDisplay.transform.localScale = _previewOriginalScale;
|
||||
|
||||
// Hide the preview card after returning to slot
|
||||
previewCardDisplay.gameObject.SetActive(false);
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Preview hidden and reset for {targetCardDefinition.Name}");
|
||||
});
|
||||
}
|
||||
|
||||
Debug.Log($"[AlbumCardSlot] Hiding preview for {targetCardDefinition.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Public method to dismiss preview - can be called by CardDisplay when clicked
|
||||
/// </summary>
|
||||
public void DismissPreview()
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-SLOT] DismissPreview called on {name}");
|
||||
HidePreview();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the target card definition for this slot
|
||||
/// </summary>
|
||||
public CardDefinition TargetCardDefinition => targetCardDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 514a349ba18d4842bc4292cb034f0d76
|
||||
timeCreated: 1762470924
|
||||
@@ -4,7 +4,6 @@ using Pixelplacement;
|
||||
using Pixelplacement.TweenSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace UI.CardSystem
|
||||
{
|
||||
@@ -18,6 +17,7 @@ namespace UI.CardSystem
|
||||
[SerializeField] private GameObject cardBackObject; // The card back visual
|
||||
[SerializeField] private GameObject cardFrontObject; // Your CardDisplay prefab instance
|
||||
[SerializeField] private CardDisplay cardDisplay; // Reference to CardDisplay component
|
||||
[SerializeField] private AlbumCard albumCard; // Reference to nested AlbumCard (for album placement flow)
|
||||
|
||||
[Header("Idle Hover Animation")]
|
||||
[SerializeField] private bool enableIdleHover = true;
|
||||
@@ -67,6 +67,12 @@ namespace UI.CardSystem
|
||||
cardDisplay = cardFrontObject.GetComponent<CardDisplay>();
|
||||
}
|
||||
|
||||
// Auto-find AlbumCard if not assigned
|
||||
if (albumCard == null)
|
||||
{
|
||||
albumCard = GetComponentInChildren<AlbumCard>();
|
||||
}
|
||||
|
||||
// Card back: starts at 0° rotation (normal, facing camera, clickable)
|
||||
// Card front: starts at 180° rotation (flipped away, will rotate to 0° when revealed)
|
||||
if (cardBackObject != null)
|
||||
@@ -254,9 +260,12 @@ namespace UI.CardSystem
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] OnPointerClick on {name}, _isClickable={_isClickable}, _isWaitingForTap={_isWaitingForTap}, _isFlipped={_isFlipped}, position={eventData.position}");
|
||||
|
||||
// If not clickable, notify and return
|
||||
if (!_isClickable)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Not clickable, firing OnClickedWhileInactive");
|
||||
OnClickedWhileInactive?.Invoke(this);
|
||||
return;
|
||||
}
|
||||
@@ -264,14 +273,19 @@ namespace UI.CardSystem
|
||||
// If waiting for tap after reveal, handle that
|
||||
if (_isWaitingForTap)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Waiting for tap, dismissing enlarged state");
|
||||
OnCardTappedAfterReveal?.Invoke(this);
|
||||
_isWaitingForTap = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isFlipped || _isFlipping)
|
||||
{
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Ignoring click (flipped={_isFlipped}, flipping={_isFlipping})");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[CLICK-TRACE-FLIPPABLE] {name} - Processing click, starting flip");
|
||||
// Flip on click
|
||||
FlipToReveal();
|
||||
}
|
||||
@@ -622,6 +636,36 @@ namespace UI.CardSystem
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract the nested AlbumCard and reparent it to a new parent
|
||||
/// Used when placing card in album slot - extracts the AlbumCard from this wrapper
|
||||
/// The caller is responsible for tweening it to the final position
|
||||
/// </summary>
|
||||
/// <param name="newParent">The transform to reparent the AlbumCard to (typically the AlbumCardSlot)</param>
|
||||
/// <returns>The extracted AlbumCard component, or null if not found</returns>
|
||||
public AlbumCard ExtractAlbumCard(Transform newParent)
|
||||
{
|
||||
if (albumCard == null)
|
||||
{
|
||||
Debug.LogWarning("[FlippableCard] Cannot extract AlbumCard - none found!");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Reparent AlbumCard to new parent (maintain world position temporarily)
|
||||
// The caller will tween it to the final position
|
||||
albumCard.transform.SetParent(newParent, true);
|
||||
|
||||
// Setup the card data on the AlbumCard
|
||||
if (_cardData != null)
|
||||
{
|
||||
albumCard.SetupCard(_cardData);
|
||||
}
|
||||
|
||||
Debug.Log($"[FlippableCard] Extracted AlbumCard '{_cardData?.Name}' to {newParent.name} - ready for tween");
|
||||
|
||||
return albumCard;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnDestroy()
|
||||
|
||||
70
Assets/Scripts/UI/CardSystem/SlotContainerHelper.cs
Normal file
70
Assets/Scripts/UI/CardSystem/SlotContainerHelper.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using UI.DragAndDrop.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI.CardSystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper utility for shuffling draggable objects in a SlotContainer.
|
||||
/// Moves objects to occupy the first available slots (0, 1, 2, etc.)
|
||||
/// </summary>
|
||||
public static class SlotContainerHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Shuffles draggable objects to always occupy the first available slots.
|
||||
/// Unassigns all objects from their current slots, then reassigns them starting from slot 0.
|
||||
/// </summary>
|
||||
/// <param name="container">The slot container holding the slots</param>
|
||||
/// <param name="objects">List of draggable objects to shuffle</param>
|
||||
/// <param name="animate">Whether to animate the movement</param>
|
||||
public static void ShuffleToFront(SlotContainer container, List<DraggableObject> objects, bool animate = true)
|
||||
{
|
||||
if (container == null || objects == null || objects.Count == 0)
|
||||
return;
|
||||
|
||||
Debug.Log($"[SlotContainerHelper] Shuffling {objects.Count} objects to front slots");
|
||||
|
||||
// Unassign all objects from their current slots
|
||||
foreach (var obj in objects)
|
||||
{
|
||||
if (obj.CurrentSlot != null)
|
||||
{
|
||||
obj.CurrentSlot.Vacate();
|
||||
}
|
||||
}
|
||||
|
||||
// Reassign objects to first N slots starting from slot 0
|
||||
for (int i = 0; i < objects.Count; i++)
|
||||
{
|
||||
DraggableSlot targetSlot = FindSlotByIndex(container, i);
|
||||
DraggableObject obj = objects[i];
|
||||
|
||||
if (targetSlot != null)
|
||||
{
|
||||
Debug.Log($"[SlotContainerHelper] Assigning object to slot with SlotIndex {i}");
|
||||
obj.AssignToSlot(targetSlot, animate);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[SlotContainerHelper] Could not find slot with SlotIndex {i}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find a slot by its SlotIndex property (not list position)
|
||||
/// </summary>
|
||||
private static DraggableSlot FindSlotByIndex(SlotContainer container, int slotIndex)
|
||||
{
|
||||
foreach (var slot in container.Slots)
|
||||
{
|
||||
if (slot.SlotIndex == slotIndex)
|
||||
{
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3
Assets/Scripts/UI/CardSystem/SlotContainerHelper.cs.meta
Normal file
3
Assets/Scripts/UI/CardSystem/SlotContainerHelper.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cad44f85ab1a4672ab4bb14e2f919413
|
||||
timeCreated: 1762470959
|
||||
@@ -18,7 +18,7 @@ namespace UI.DragAndDrop.Core
|
||||
}
|
||||
|
||||
[Header("Slot Settings")]
|
||||
[SerializeField] private int slotIndex;
|
||||
[SerializeField] private int slotIndex = -1;
|
||||
[SerializeField] private bool isLocked;
|
||||
[SerializeField] private bool hideImageOnPlay = false;
|
||||
|
||||
|
||||
@@ -69,7 +69,13 @@ namespace UI.DragAndDrop.Core
|
||||
return;
|
||||
|
||||
_slots.Add(slot);
|
||||
slot.SetSlotIndex(_slots.Count - 1);
|
||||
|
||||
// Only auto-assign index if slot's index is -1 (default/unset)
|
||||
// Otherwise keep the custom index set in the inspector
|
||||
if (slot.SlotIndex == -1)
|
||||
{
|
||||
slot.SetSlotIndex(_slots.Count - 1);
|
||||
}
|
||||
|
||||
OnSlotAdded?.Invoke(slot);
|
||||
UpdateLayout();
|
||||
@@ -86,11 +92,8 @@ namespace UI.DragAndDrop.Core
|
||||
_slots.Remove(slot);
|
||||
OnSlotRemoved?.Invoke(slot);
|
||||
|
||||
// Re-index remaining slots
|
||||
for (int i = 0; i < _slots.Count; i++)
|
||||
{
|
||||
_slots[i].SetSlotIndex(i);
|
||||
}
|
||||
// Note: We don't re-index remaining slots anymore to preserve custom indices
|
||||
// Slots with custom indices will keep them, slots with auto-assigned indices will also keep them
|
||||
|
||||
UpdateLayout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user