notebook实装功能,galgame继续,一些bug修复

This commit is contained in:
FloatGaming
2026-03-06 02:08:43 +08:00
parent 9011fa022e
commit 1f4077cf21
468 changed files with 50175 additions and 11402 deletions
@@ -26,7 +26,7 @@ RectTransform:
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_ConstrainProportionsScale: 1
m_Children:
- {fileID: 3426810894855294520}
- {fileID: 4787860189400675959}
@@ -34,6 +34,7 @@ RectTransform:
- {fileID: 7481797042088762975}
- {fileID: 1351079257240028571}
- {fileID: 7655426131176574856}
- {fileID: 6114414043575968418}
m_Father: {fileID: 2613971938742376913}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -97,7 +98,7 @@ MonoBehaviour:
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 3
m_Spacing: 3
m_Spacing: 9.55
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
@@ -141,7 +142,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 25, y: 25}
m_SizeDelta: {x: 35, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4734727163133092417
CanvasRenderer:
@@ -248,11 +249,11 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 20
m_FontSize: 25
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 20
m_MaxSize: 25
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
@@ -327,11 +328,11 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 20
m_FontSize: 25
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 20
m_MaxSize: 25
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
@@ -365,7 +366,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1300686028162242880}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -0.8}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -373,8 +374,8 @@ RectTransform:
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: -2.5252686, y: 4.807846}
m_SizeDelta: {x: 128.8411, y: 125.2335}
m_AnchoredPosition: {x: -3.1, y: 3.8}
m_SizeDelta: {x: 145.324, y: 141.255}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2417251892043802145
CanvasRenderer:
@@ -450,7 +451,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 25, y: 25}
m_SizeDelta: {x: 35, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4210288393527682798
CanvasRenderer:
@@ -524,7 +525,7 @@ RectTransform:
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: -80, y: 0}
m_AnchoredPosition: {x: -65, y: 0}
m_SizeDelta: {x: 90, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8683684367698790289
@@ -557,7 +558,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 18
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
@@ -636,11 +637,11 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 20
m_FontSize: 25
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 20
m_MaxSize: 25
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
@@ -674,7 +675,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1803836327666263803}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -682,8 +683,8 @@ RectTransform:
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: -2.5252686, y: 5.411278}
m_SizeDelta: {x: 103.0728, y: 103.0728}
m_AnchoredPosition: {x: -3, y: 4.3}
m_SizeDelta: {x: 123.437, y: 123.437}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1406633831322811249
CanvasRenderer:
@@ -758,7 +759,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.011796877, y: -0.0034751892}
m_SizeDelta: {x: 240.82, y: 30.11}
m_SizeDelta: {x: 301.5, y: 30.11}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3017584836910545941
CanvasRenderer:
@@ -929,11 +930,11 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 20
m_FontSize: 25
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 20
m_MaxSize: 25
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
@@ -1031,7 +1032,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2879873275385921024}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -4.84}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -1039,8 +1040,8 @@ RectTransform:
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: -220.10004, y: 60.999985}
m_SizeDelta: {x: 486.0001, y: 162}
m_AnchoredPosition: {x: -249.586, y: 55.236}
m_SizeDelta: {x: 544.972, y: 181.657}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5280582095696078567
CanvasRenderer:
@@ -1116,7 +1117,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 25, y: 25}
m_SizeDelta: {x: 35, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7316102496420409225
CanvasRenderer:
@@ -1267,7 +1268,7 @@ RectTransform:
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: 68, y: 15}
m_AnchoredPosition: {x: 65.8, y: 15}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &7982449552540773536
@@ -1439,18 +1440,18 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 20
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 20
m_MaxSize: 22
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 350234
m_Text: 2255023
--- !u!1 &3373680310273385780
GameObject:
m_ObjectHideFlags: 0
@@ -1485,7 +1486,7 @@ RectTransform:
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: -80, y: 0}
m_AnchoredPosition: {x: -65, y: 0}
m_SizeDelta: {x: 90, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8439903389052874367
@@ -1518,7 +1519,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 18
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
@@ -1628,8 +1629,8 @@ RectTransform:
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: -80, y: 0}
m_SizeDelta: {x: 90, y: 30}
m_AnchoredPosition: {x: -77.114, y: 0}
m_SizeDelta: {x: 95.773, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3533238549364255986
CanvasRenderer:
@@ -1661,7 +1662,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 18
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
@@ -1744,8 +1745,8 @@ RectTransform:
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: -80, y: 0}
m_SizeDelta: {x: 90, y: 30}
m_AnchoredPosition: {x: -77.114, y: 0}
m_SizeDelta: {x: 95.773, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1513130722049452815
CanvasRenderer:
@@ -1777,7 +1778,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 18
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
@@ -1935,7 +1936,7 @@ RectTransform:
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: -313.46063, y: 50}
m_AnchoredPosition: {x: -324.5, y: 45.2}
m_SizeDelta: {x: 233, y: 36}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4531879398774622215
@@ -1980,7 +1981,7 @@ RectTransform:
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: -284.47562, y: 95.52118}
m_AnchoredPosition: {x: -326.8, y: 95.52118}
m_SizeDelta: {x: 290.97, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3659676079848674504
@@ -2315,7 +2316,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: -251.8, y: -8.57}
m_AnchoredPosition: {x: -293.1, y: -8.57}
m_SizeDelta: {x: 200, y: 90}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &685427306910703188
@@ -2336,7 +2337,7 @@ MonoBehaviour:
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 1
m_Spacing: -28.09
m_Spacing: -21.34
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 0
@@ -2400,7 +2401,7 @@ MonoBehaviour:
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 5
m_Spacing: 3
m_Spacing: 9.55
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
@@ -2438,7 +2439,6 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4148755058004053777}
- {fileID: 6494845825576441926}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -2496,7 +2496,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6682492808549074205}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -4.402}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -2506,8 +2506,8 @@ RectTransform:
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: -58.0542, y: 61.1}
m_SizeDelta: {x: 128.8411, y: 125.2335}
m_AnchoredPosition: {x: -67.251, y: 53.9}
m_SizeDelta: {x: 147.235, y: 143.112}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2643565460332953122
CanvasRenderer:
@@ -2547,6 +2547,42 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1.5
--- !u!1 &6853683024340712328
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6114414043575968418}
m_Layer: 0
m_Name: detail
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6114414043575968418
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6853683024340712328}
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: 6494845825576441926}
m_Father: {fileID: 4148755058004053777}
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: -177.5, y: -5.2}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &7151601246212580972
GameObject:
m_ObjectHideFlags: 0
@@ -2657,7 +2693,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.17, y: -38.91}
m_SizeDelta: {x: 240.82, y: 22.17}
m_SizeDelta: {x: 301.5, y: 22.17}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7024596005729876765
CanvasRenderer:
@@ -2764,11 +2800,11 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 20
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 0
m_MaxSize: 20
m_MaxSize: 22
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
@@ -2850,7 +2886,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0.01, y: -38.91}
m_SizeDelta: {x: 240.58, y: 22.17}
m_SizeDelta: {x: 301.5, y: 22.17}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4552223981125847129
CanvasRenderer:
@@ -2929,7 +2965,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7749677393578589965}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -5.087}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -2938,8 +2974,8 @@ RectTransform:
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: -597.3, y: 60.999985}
m_SizeDelta: {x: 271.5, y: 162}
m_AnchoredPosition: {x: -670.5, y: 54.942}
m_SizeDelta: {x: 302.667, y: 182.657}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &810551395488659022
CanvasRenderer:
@@ -3005,13 +3041,13 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7889622464149315732}
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: 4489091791280738956}
m_Father: {fileID: 2613971938742376913}
m_Father: {fileID: 6114414043575968418}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -3247,8 +3283,8 @@ RectTransform:
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: -80, y: 0}
m_SizeDelta: {x: 90, y: 30}
m_AnchoredPosition: {x: -77.114, y: 0}
m_SizeDelta: {x: 95.773, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &492154790085150397
CanvasRenderer:
@@ -3280,7 +3316,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 18
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
@@ -3478,7 +3514,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 25, y: 25}
m_SizeDelta: {x: 35, y: 25}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6314649216240834215
CanvasRenderer:
@@ -3627,8 +3663,8 @@ RectTransform:
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: -80, y: 0}
m_SizeDelta: {x: 90, y: 30}
m_AnchoredPosition: {x: -77.114, y: 0}
m_SizeDelta: {x: 95.773, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1247215313835421715
CanvasRenderer:
@@ -3660,7 +3696,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 18
m_FontSize: 22
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
@@ -1,5 +1,8 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
public class loadSettlementTeamPrefab : MonoBehaviour
{
@@ -11,6 +14,18 @@ public class loadSettlementTeamPrefab : MonoBehaviour
public GameObject settleTeamCardsPrefab;
public GameObject objectToPutdown;
[Header("Settlement Entry Animation")]
[SerializeField] private bool enableAllySlotEntryTween = true;
[SerializeField] private float allySlotEntryOffsetX = 240f;
[SerializeField] private float allySlotEntryDuration = 0.35f;
[SerializeField] private float allySlotEntryStagger = 0.06f;
[SerializeField] private Ease allySlotEntryEase = Ease.OutCubic;
[SerializeField] private bool allySlotEntryUseUnscaledTime = true;
private readonly List<RectTransform> spawnedCardRoots = new List<RectTransform>();
private readonly List<Vector2> spawnedCardBasePositions = new List<Vector2>();
private Sequence allySlotEntrySequence;
/// <summary>
/// Instantiate five settlement cards under objectToPutdown and populate their fields.
/// Uses tuic.GetCurrentAllySOs() for profile/name when available, falls back to AllyHero_SO via allySlotIds.
@@ -18,6 +33,10 @@ public class loadSettlementTeamPrefab : MonoBehaviour
/// </summary>
public void PopulateSettlementCards()
{
KillAllySlotEntrySequence();
spawnedCardRoots.Clear();
spawnedCardBasePositions.Clear();
if (settleTeamCardsPrefab == null)
{
Debug.LogWarning("loadSettlementTeamPrefab: prefab not assigned");
@@ -86,6 +105,7 @@ public class loadSettlementTeamPrefab : MonoBehaviour
{
rectTransform.anchoredPosition = Vector2.zero;
rectTransform.sizeDelta = Vector2.zero;
spawnedCardRoots.Add(rectTransform);
}
// Diagnostic: verify parenting applied
@@ -244,6 +264,81 @@ public class loadSettlementTeamPrefab : MonoBehaviour
if (GameConfig.verboseLogs) Debug.Log($"[loadSettlementTeamPrefab] Created card for slot {i+1}");
}
CaptureSpawnedCardBasePositions();
if (enableAllySlotEntryTween)
SetSpawnedCardsAlpha(0f);
}
public IEnumerator PlayAllySlotEntryBeforeMask()
{
if (!enableAllySlotEntryTween)
yield break;
CaptureSpawnedCardBasePositions();
if (spawnedCardRoots.Count == 0)
yield break;
KillAllySlotEntrySequence();
float duration = Mathf.Max(0.01f, allySlotEntryDuration);
float stagger = Mathf.Max(0f, allySlotEntryStagger);
float offsetX = allySlotEntryOffsetX;
allySlotEntrySequence = DOTween.Sequence().SetUpdate(allySlotEntryUseUnscaledTime);
for (int i = 0; i < spawnedCardRoots.Count; i++)
{
RectTransform rt = spawnedCardRoots[i];
if (rt == null) continue;
Vector2 basePos = spawnedCardBasePositions[i];
CanvasGroup group = GetOrAddCanvasGroup(rt.transform);
if (group != null) group.alpha = 0f;
rt.anchoredPosition = new Vector2(basePos.x + offsetX, basePos.y);
float startAt = i * stagger; // top -> bottom (sibling order)
allySlotEntrySequence.Insert(startAt, rt.DOAnchorPos(basePos, duration).SetEase(allySlotEntryEase).SetUpdate(allySlotEntryUseUnscaledTime));
if (group != null)
allySlotEntrySequence.Insert(startAt, group.DOFade(1f, duration).SetEase(allySlotEntryEase).SetUpdate(allySlotEntryUseUnscaledTime));
}
if (allySlotEntrySequence != null && allySlotEntrySequence.active)
yield return allySlotEntrySequence.WaitForCompletion();
allySlotEntrySequence = null;
}
public bool HasSpawnedCards()
{
if (!enableAllySlotEntryTween)
return false;
if (spawnedCardRoots.Count > 0)
return true;
return objectToPutdown != null && objectToPutdown.transform.childCount > 0;
}
public void ShowSpawnedCardsInstantly()
{
CaptureSpawnedCardBasePositions();
SetSpawnedCardsAlpha(1f);
}
public void CompleteAllySlotEntryImmediately()
{
CaptureSpawnedCardBasePositions();
KillAllySlotEntrySequence();
for (int i = 0; i < spawnedCardRoots.Count; i++)
{
RectTransform rt = spawnedCardRoots[i];
if (rt == null) continue;
if (i < spawnedCardBasePositions.Count)
rt.anchoredPosition = spawnedCardBasePositions[i];
SetCanvasAlpha(rt.transform, 1f);
}
}
/// <summary>
@@ -264,4 +359,90 @@ public class loadSettlementTeamPrefab : MonoBehaviour
}
return $"{designation} {name}";
}
private void OnDisable()
{
KillAllySlotEntrySequence();
}
private void CaptureSpawnedCardBasePositions()
{
if (objectToPutdown == null)
return;
Canvas.ForceUpdateCanvases();
RectTransform parentRt = objectToPutdown.transform as RectTransform;
if (parentRt != null)
LayoutRebuilder.ForceRebuildLayoutImmediate(parentRt);
List<RectTransform> validCards = new List<RectTransform>();
// Prefer freshly instantiated references from this run.
for (int i = 0; i < spawnedCardRoots.Count; i++)
{
RectTransform rt = spawnedCardRoots[i];
if (rt == null) continue;
if (rt.parent != objectToPutdown.transform) continue;
validCards.Add(rt);
}
// Fallback scan if cache is empty.
if (validCards.Count == 0)
{
Transform parent = objectToPutdown.transform;
for (int i = 0; i < parent.childCount; i++)
{
RectTransform rt = parent.GetChild(i) as RectTransform;
if (rt == null) continue;
validCards.Add(rt);
}
}
validCards.Sort((a, b) => a.GetSiblingIndex().CompareTo(b.GetSiblingIndex()));
spawnedCardRoots.Clear();
spawnedCardBasePositions.Clear();
for (int i = 0; i < validCards.Count; i++)
{
RectTransform rt = validCards[i];
spawnedCardRoots.Add(rt);
spawnedCardBasePositions.Add(rt.anchoredPosition);
SetCanvasAlpha(rt.transform, 1f);
}
}
private void SetSpawnedCardsAlpha(float alpha)
{
float clamped = Mathf.Clamp01(alpha);
for (int i = 0; i < spawnedCardRoots.Count; i++)
{
RectTransform rt = spawnedCardRoots[i];
if (rt == null) continue;
SetCanvasAlpha(rt.transform, clamped);
}
}
private void KillAllySlotEntrySequence()
{
if (allySlotEntrySequence == null)
return;
if (allySlotEntrySequence.active)
allySlotEntrySequence.Kill(false);
allySlotEntrySequence = null;
}
private static CanvasGroup GetOrAddCanvasGroup(Transform root)
{
if (root == null) return null;
CanvasGroup cg = root.GetComponent<CanvasGroup>();
if (cg == null) cg = root.gameObject.AddComponent<CanvasGroup>();
return cg;
}
private static void SetCanvasAlpha(Transform root, float alpha)
{
CanvasGroup cg = GetOrAddCanvasGroup(root);
if (cg == null) return;
cg.alpha = Mathf.Clamp01(alpha);
}
}