UI HUGE UPDATE
This commit is contained in:
@@ -0,0 +1,207 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2385439052447979022
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2709983082172120799}
|
||||
- component: {fileID: 2847136257128320079}
|
||||
- component: {fileID: 3098130081588452963}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2709983082172120799
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2385439052447979022}
|
||||
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: 1232571476962707068}
|
||||
m_Father: {fileID: 6238409934230309402}
|
||||
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: 226, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2847136257128320079
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2385439052447979022}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3098130081588452963
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2385439052447979022}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
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: 21300000, guid: 374deeecafefea14cb9c506944b98b08, 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 &2988348529866371969
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6238409934230309402}
|
||||
- component: {fileID: 3566225389816842317}
|
||||
m_Layer: 0
|
||||
m_Name: columnPrefab
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6238409934230309402
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2988348529866371969}
|
||||
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: 2709983082172120799}
|
||||
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: 226, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &3566225389816842317
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2988348529866371969}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e2905a34069d2f347b6facc196e62ae6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
columnText: {fileID: 7581415437482976656}
|
||||
--- !u!1 &4201383612783777168
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1232571476962707068}
|
||||
- component: {fileID: 2063637685932881627}
|
||||
- component: {fileID: 7581415437482976656}
|
||||
m_Layer: 0
|
||||
m_Name: text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1232571476962707068
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4201383612783777168}
|
||||
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: 2709983082172120799}
|
||||
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: -25.9662, y: 0}
|
||||
m_SizeDelta: {x: 151.9325, y: 38.37}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2063637685932881627
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4201383612783777168}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7581415437482976656
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4201383612783777168}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: cc180dff846d13a4d88ddaed6f77e5cd, type: 3}
|
||||
m_FontSize: 20
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: columnText
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cf7b74eb992b4a4a9d4e1e973b05d20
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,160 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1891367583317601643
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4266754306481162919}
|
||||
- component: {fileID: 6955911029995934163}
|
||||
- component: {fileID: 5045373100862751408}
|
||||
m_Layer: 0
|
||||
m_Name: text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4266754306481162919
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1891367583317601643}
|
||||
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: 7542282414224761316}
|
||||
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: -25.9662, y: 0}
|
||||
m_SizeDelta: {x: 151.9325, y: 38.37}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6955911029995934163
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1891367583317601643}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5045373100862751408
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1891367583317601643}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: cc180dff846d13a4d88ddaed6f77e5cd, type: 3}
|
||||
m_FontSize: 20
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: columnText
|
||||
--- !u!1 &2545875886434900151
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7542282414224761316}
|
||||
- component: {fileID: 3260669185316698798}
|
||||
- component: {fileID: 2818831569670565847}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7542282414224761316
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2545875886434900151}
|
||||
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: 4266754306481162919}
|
||||
m_Father: {fileID: 6988326929107498435}
|
||||
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: 226, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3260669185316698798
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2545875886434900151}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2818831569670565847
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2545875886434900151}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
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: 21300000, guid: 374deeecafefea14cb9c506944b98b08, 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 &8543087319720739685
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -12,6 +167,7 @@ GameObject:
|
||||
- component: {fileID: 8690290934256204690}
|
||||
- component: {fileID: 9211739895151529780}
|
||||
- component: {fileID: 478932237340675732}
|
||||
- component: {fileID: 2381408257881321676}
|
||||
m_Layer: 0
|
||||
m_Name: columnText
|
||||
m_TagString: Untagged
|
||||
@@ -30,12 +186,13 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 7542282414224761316}
|
||||
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: 150, y: 10}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -1770, y: -1070}
|
||||
m_SizeDelta: {x: 300, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8690290934256204690
|
||||
@@ -53,7 +210,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8543087319720739685}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
@@ -94,3 +251,16 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_VerticalFit: 2
|
||||
--- !u!114 &2381408257881321676
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8543087319720739685}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e2905a34069d2f347b6facc196e62ae6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
columnText: {fileID: 5045373100862751408}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class heroSkill_columnText : MonoBehaviour
|
||||
{
|
||||
[Header("UI")]
|
||||
public Text columnText;
|
||||
|
||||
public void SetColumnText(string value)
|
||||
{
|
||||
if (columnText != null)
|
||||
{
|
||||
columnText.text = value ?? string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2905a34069d2f347b6facc196e62ae6
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1232761195082583041
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3288998552322750881}
|
||||
- component: {fileID: 2666417736726883560}
|
||||
- component: {fileID: 8012383617062284676}
|
||||
m_Layer: 0
|
||||
m_Name: text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3288998552322750881
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1232761195082583041}
|
||||
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: 452362441709949700}
|
||||
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: -25.9662, y: 0}
|
||||
m_SizeDelta: {x: 151.9325, y: 38.37}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2666417736726883560
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1232761195082583041}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8012383617062284676
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1232761195082583041}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: cc180dff846d13a4d88ddaed6f77e5cd, type: 3}
|
||||
m_FontSize: 20
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: columnText
|
||||
--- !u!1 &1421143352674697207
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 452362441709949700}
|
||||
- component: {fileID: 2587130538739575944}
|
||||
- component: {fileID: 3689432155723237934}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &452362441709949700
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1421143352674697207}
|
||||
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: 3288998552322750881}
|
||||
m_Father: {fileID: 9080497951897835063}
|
||||
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: -2252.4202, y: -1209.8014}
|
||||
m_SizeDelta: {x: 226, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2587130538739575944
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1421143352674697207}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3689432155723237934
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1421143352674697207}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
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: 21300000, guid: 374deeecafefea14cb9c506944b98b08, 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 &4637514227818652011
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9080497951897835063}
|
||||
- component: {fileID: 5249281038033086723}
|
||||
m_Layer: 0
|
||||
m_Name: heroskillcard_columnPrefab
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &9080497951897835063
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4637514227818652011}
|
||||
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:
|
||||
- {fileID: 452362441709949700}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &5249281038033086723
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4637514227818652011}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e2905a34069d2f347b6facc196e62ae6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
columnText: {fileID: 8012383617062284676}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eff937d77cefcc2438310895f06ce6c5
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Linq;
|
||||
|
||||
public class loadDetailsPrefab : MonoBehaviour
|
||||
{
|
||||
@@ -14,12 +14,15 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
[Header("Settings")]
|
||||
public float hoverDelay = 0.5f;
|
||||
|
||||
[Tooltip("Documentation text normalized.")]
|
||||
[Tooltip("Retained for inspector compatibility.")]
|
||||
public Vector2 offsetPercent = new Vector2(0f, -0.03f);
|
||||
|
||||
[Tooltip("Documentation text normalized.")]
|
||||
[Tooltip("Retained for inspector compatibility.")]
|
||||
public Vector2 minOffsetPixels = new Vector2(0f, -50f);
|
||||
|
||||
[Tooltip("Horizontal spacing between cursor and details popup.")]
|
||||
public float cursorHorizontalGap = 24f;
|
||||
|
||||
[Header("Enter Animation")]
|
||||
public bool playEnterAnimation = true;
|
||||
[Min(0.01f)] public float enterAnimDuration = 0.2f;
|
||||
@@ -29,28 +32,34 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
private detailsPrefabController currentController;
|
||||
private Coroutine showCoroutine;
|
||||
private Coroutine enterAnimCoroutine;
|
||||
private bool isAbove; // Documentation text normalized.
|
||||
private bool preferLeftOfCursor;
|
||||
|
||||
void Awake()
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowDetails(string type, string name, string status, string description, Vector3 position, int heroLevel = 0)
|
||||
{
|
||||
HideDetails();
|
||||
|
||||
if (detailsPrefab == null) return;
|
||||
|
||||
isAbove = (type == "技能"); // Documentation text normalized.
|
||||
if (detailsPrefab == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
preferLeftOfCursor = ShouldDisplayOnLeft(type, heroLevel);
|
||||
showCoroutine = StartCoroutine(ShowDetailsDelayed(type, name, status, description, position, heroLevel));
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator ShowDetailsDelayed(string type, string name, string status, string description, Vector3 position, int heroLevel)
|
||||
private IEnumerator ShowDetailsDelayed(string type, string name, string status, string description, Vector3 position, int heroLevel)
|
||||
{
|
||||
yield return new WaitForSeconds(hoverDelay);
|
||||
|
||||
@@ -62,41 +71,55 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
{
|
||||
Debug.LogError("detailsPrefab missing detailsPrefabController component");
|
||||
Destroy(currentDetailsInstance);
|
||||
currentDetailsInstance = null;
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (currentController.item_nameText != null) currentController.item_nameText.text = name;
|
||||
if (currentController.item_typeText != null) currentController.item_typeText.text = type;
|
||||
if (currentController.item_statusText != null) currentController.item_statusText.text = status;
|
||||
if (currentController.item_nameText != null)
|
||||
{
|
||||
currentController.item_nameText.text = name;
|
||||
}
|
||||
|
||||
if (currentController.item_typeText != null)
|
||||
{
|
||||
currentController.item_typeText.text = type;
|
||||
}
|
||||
|
||||
if (currentController.item_statusText != null)
|
||||
{
|
||||
currentController.item_statusText.text = status;
|
||||
}
|
||||
|
||||
if (currentController.item_detailInformationText != null)
|
||||
{
|
||||
currentController.item_detailInformationText.text = ProcessDescription(description, heroLevel);
|
||||
}
|
||||
|
||||
if (currentController.item_statusText != null)
|
||||
ApplyStatusColor(status);
|
||||
|
||||
RectTransform rt = currentDetailsInstance.GetComponent<RectTransform>();
|
||||
CanvasGroup cg = currentDetailsInstance.GetComponent<CanvasGroup>();
|
||||
if (cg == null)
|
||||
{
|
||||
Color statusColor;
|
||||
if (status == "可装备" || status == "已装备" || status == "可用")
|
||||
{
|
||||
statusColor = currentController.availableColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
statusColor = currentController.unavailableColor;
|
||||
}
|
||||
statusColor.a = 1f;
|
||||
currentController.item_statusText.color = statusColor;
|
||||
cg = currentDetailsInstance.AddComponent<CanvasGroup>();
|
||||
}
|
||||
|
||||
SetupPosition(position);
|
||||
|
||||
CanvasGroup cg = currentDetailsInstance.GetComponent<CanvasGroup>();
|
||||
if (cg == null) cg = currentDetailsInstance.AddComponent<CanvasGroup>();
|
||||
cg.blocksRaycasts = false;
|
||||
cg.alpha = playEnterAnimation ? 0f : 1f;
|
||||
|
||||
currentDetailsInstance.SetActive(true);
|
||||
RebuildDetailsLayout(rt);
|
||||
SetupPosition(position);
|
||||
|
||||
yield return null;
|
||||
|
||||
if (currentDetailsInstance == null)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
RebuildDetailsLayout(rt);
|
||||
AdjustPositionWithinCanvas(rt, GetCanvas());
|
||||
|
||||
if (playEnterAnimation)
|
||||
{
|
||||
@@ -106,162 +129,163 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
enterAnimCoroutine = null;
|
||||
}
|
||||
|
||||
RectTransform rt = currentDetailsInstance.GetComponent<RectTransform>();
|
||||
enterAnimCoroutine = StartCoroutine(PlayEnterAnimation(rt, cg));
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyStatusColor(string status)
|
||||
{
|
||||
if (currentController == null || currentController.item_statusText == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool isAvailable =
|
||||
status == "可装载" ||
|
||||
status == "已装载" ||
|
||||
status == "可用";
|
||||
|
||||
Color statusColor = isAvailable
|
||||
? currentController.availableColor
|
||||
: currentController.unavailableColor;
|
||||
|
||||
statusColor.a = 1f;
|
||||
currentController.item_statusText.color = statusColor;
|
||||
}
|
||||
|
||||
private string ProcessDescription(string desc, int level)
|
||||
{
|
||||
if (string.IsNullOrEmpty(desc)) return desc;
|
||||
if (string.IsNullOrEmpty(desc))
|
||||
{
|
||||
return desc;
|
||||
}
|
||||
|
||||
// 定义数值组匹配模式:由斜杠分割的数值(数字、小数点、百分号)
|
||||
// 使用更严谨的正则,确保匹配整个连续的斜杠组,避免被拆分成多个匹配
|
||||
// (?<!/) 和 (?!/) 确保匹配的组前后没有斜杠,即匹配最长的完整链
|
||||
string groupPattern = @"(?<!/)[\d\.%]+(\s*/\s*[\d\.%]+)+(?!/)";
|
||||
|
||||
// 如果描述中包含斜杠数值组
|
||||
if (Regex.IsMatch(desc, groupPattern))
|
||||
{
|
||||
// 使用 Regex.Replace 进行处理,但增加一层验证,确保不重复处理已加粗的内容
|
||||
return Regex.Replace(desc, groupPattern, m => {
|
||||
string val = m.Value;
|
||||
// 分割出数值和分隔符
|
||||
string[] parts = Regex.Split(val, @"(\s*/\s*)");
|
||||
|
||||
// 实际的数值在 0, 2, 4, 6... 索引位置
|
||||
return Regex.Replace(desc, groupPattern, match =>
|
||||
{
|
||||
string[] parts = Regex.Split(match.Value, @"(\s*/\s*)");
|
||||
int actualValueCount = (parts.Length + 1) / 2;
|
||||
int highlightIndex = -1;
|
||||
|
||||
// 根据数值总数判断映射规则 (CBAS/BAS/AS)
|
||||
if (actualValueCount == 4) // CBAS
|
||||
if (actualValueCount == 4)
|
||||
{
|
||||
if (level >= 1 && level <= 4) highlightIndex = (level - 1) * 2;
|
||||
if (level >= 1 && level <= 4)
|
||||
{
|
||||
highlightIndex = (level - 1) * 2;
|
||||
}
|
||||
}
|
||||
else if (actualValueCount == 3) // BAS
|
||||
else if (actualValueCount == 3)
|
||||
{
|
||||
if (level >= 2 && level <= 4) highlightIndex = (level - 2) * 2;
|
||||
if (level >= 2 && level <= 4)
|
||||
{
|
||||
highlightIndex = (level - 2) * 2;
|
||||
}
|
||||
}
|
||||
else if (actualValueCount == 2) // AS
|
||||
else if (actualValueCount == 2)
|
||||
{
|
||||
if (level >= 3 && level <= 4) highlightIndex = (level - 3) * 2;
|
||||
if (level >= 3 && level <= 4)
|
||||
{
|
||||
highlightIndex = (level - 3) * 2;
|
||||
}
|
||||
}
|
||||
|
||||
// 只加粗目标索引对应的数值
|
||||
for (int i = 0; i < parts.Length; i += 2)
|
||||
{
|
||||
string rawValue = parts[i];
|
||||
string trimmedValue = rawValue.Trim();
|
||||
|
||||
|
||||
if (i == highlightIndex)
|
||||
{
|
||||
// 加粗当前等级对应的数值
|
||||
int firstIdx = rawValue.IndexOf(trimmedValue);
|
||||
if (firstIdx >= 0)
|
||||
int firstIndex = rawValue.IndexOf(trimmedValue);
|
||||
if (firstIndex >= 0)
|
||||
{
|
||||
string leading = rawValue.Substring(0, firstIdx);
|
||||
string trailing = rawValue.Substring(firstIdx + trimmedValue.Length);
|
||||
string leading = rawValue.Substring(0, firstIndex);
|
||||
string trailing = rawValue.Substring(firstIndex + trimmedValue.Length);
|
||||
parts[i] = leading + "<b>" + trimmedValue + "</b>" + trailing;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 确保其他索引位置的数值没有加粗标签(防止重复处理的情况)
|
||||
parts[i] = rawValue.Replace("<b>", "").Replace("</b>", "");
|
||||
parts[i] = rawValue.Replace("<b>", string.Empty).Replace("</b>", string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return string.Concat(parts);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果没找到斜杠数值组,就把段落中所有独立数值加粗
|
||||
string singlePattern = @"[\d\.%]+";
|
||||
return Regex.Replace(desc, singlePattern, m => "<b>" + m.Value + "</b>");
|
||||
}
|
||||
|
||||
return Regex.Replace(desc, @"[\d\.%]+", match => "<b>" + match.Value + "</b>");
|
||||
}
|
||||
|
||||
private void SetupPosition(Vector3 position)
|
||||
{
|
||||
RectTransform rt = currentDetailsInstance.GetComponent<RectTransform>();
|
||||
if (rt == null) return;
|
||||
|
||||
Canvas canvas = GetCanvas();
|
||||
if (canvas == null) return;
|
||||
|
||||
RectTransform canvasRect = canvas.GetComponent<RectTransform>();
|
||||
|
||||
// Documentation text normalized.
|
||||
Vector2 dynamicOffset = CalculateDynamicOffset();
|
||||
Vector2 baseScreenPos = new Vector2(position.x, position.y) + dynamicOffset;
|
||||
|
||||
// Documentation text normalized.
|
||||
float prefWidthPixels = rt.rect.width * (canvas != null ? canvas.scaleFactor : 1f);
|
||||
float maxNudge = prefWidthPixels*4; // now allow up to full prefab width
|
||||
|
||||
// Documentation text normalized.
|
||||
float screenCenterX = Screen.width * 0.5f;
|
||||
float normalized = 0f;
|
||||
if (screenCenterX > 0f)
|
||||
normalized = (position.x - screenCenterX) / screenCenterX; // -1(left) .. 0(center) .. +1(right)
|
||||
normalized = Mathf.Clamp(normalized, -1f, 1f);
|
||||
|
||||
// Documentation text normalized.
|
||||
float nudge = -normalized * maxNudge;
|
||||
Vector2 screenPos = baseScreenPos + new Vector2(nudge, 0f);
|
||||
|
||||
Vector3 initialPos = CalculateWorldPos(screenPos, canvas, canvasRect, rt);
|
||||
|
||||
// Documentation text normalized.
|
||||
if (IsOutOfCanvas(initialPos, rt, canvas))
|
||||
if (currentDetailsInstance == null)
|
||||
{
|
||||
isAbove = !isAbove;
|
||||
dynamicOffset = CalculateDynamicOffset();
|
||||
baseScreenPos = new Vector2(position.x, position.y) + dynamicOffset;
|
||||
|
||||
// Documentation text normalized.
|
||||
if (screenCenterX > 0f)
|
||||
normalized = (position.x - screenCenterX) / screenCenterX;
|
||||
normalized = Mathf.Clamp(normalized, -1f, 1f);
|
||||
nudge = -normalized * maxNudge;
|
||||
screenPos = baseScreenPos + new Vector2(nudge, 0f);
|
||||
|
||||
initialPos = CalculateWorldPos(screenPos, canvas, canvasRect, rt);
|
||||
return;
|
||||
}
|
||||
|
||||
rt.position = initialPos;
|
||||
RectTransform rt = currentDetailsInstance.GetComponent<RectTransform>();
|
||||
if (rt == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Canvas canvas = GetCanvas();
|
||||
if (canvas == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RectTransform canvasRect = canvas.GetComponent<RectTransform>();
|
||||
RebuildDetailsLayout(rt);
|
||||
|
||||
float scaleFactor = Mathf.Max(canvas.scaleFactor, 0.0001f);
|
||||
float prefabWidthPixels = rt.rect.width * scaleFactor;
|
||||
float horizontalOffset = prefabWidthPixels * 0.5f + Mathf.Max(0f, cursorHorizontalGap);
|
||||
float direction = preferLeftOfCursor ? -1f : 1f;
|
||||
|
||||
Vector2 screenPos = new Vector2(position.x + direction * horizontalOffset, position.y);
|
||||
SetPositionFromScreenPoint(rt, screenPos, canvas, canvasRect);
|
||||
RebuildDetailsLayout(rt);
|
||||
|
||||
if (IsOutOfCanvas(rt.position, rt, canvas))
|
||||
{
|
||||
screenPos = new Vector2(position.x - direction * horizontalOffset, position.y);
|
||||
SetPositionFromScreenPoint(rt, screenPos, canvas, canvasRect);
|
||||
RebuildDetailsLayout(rt);
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
AdjustPositionWithinCanvas(rt, canvas);
|
||||
}
|
||||
|
||||
private Vector3 CalculateWorldPos(Vector2 screenPos, Canvas canvas, RectTransform canvasRect, RectTransform rt)
|
||||
private bool ShouldDisplayOnLeft(string type, int heroLevel)
|
||||
{
|
||||
if (canvas.renderMode == RenderMode.ScreenSpaceCamera && canvas.worldCamera != null)
|
||||
if (heroLevel > 0)
|
||||
{
|
||||
Vector2 localPoint;
|
||||
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(
|
||||
canvasRect,
|
||||
screenPos,
|
||||
canvas.worldCamera,
|
||||
out localPoint))
|
||||
{
|
||||
return canvasRect.TransformPoint(localPoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
return screenPos;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return type.Contains("技") || type.Contains("能");
|
||||
}
|
||||
|
||||
private void SetPositionFromScreenPoint(RectTransform rt, Vector2 screenPos, Canvas canvas, RectTransform canvasRect)
|
||||
{
|
||||
Camera eventCamera = GetCanvasEventCamera(canvas);
|
||||
Vector2 localPoint;
|
||||
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, screenPos, eventCamera, out localPoint))
|
||||
{
|
||||
rt.position = canvasRect.TransformPoint(localPoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
float scaleFactor = canvas.scaleFactor;
|
||||
return new Vector3(
|
||||
screenPos.x / scaleFactor,
|
||||
screenPos.y / scaleFactor,
|
||||
0
|
||||
);
|
||||
rt.position = screenPos;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,53 +300,17 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
float canvasBottom = canvasCorners[0].y;
|
||||
float canvasTop = canvasCorners[2].y;
|
||||
|
||||
// Documentation text normalized.
|
||||
Vector3 originalPos = rt.position;
|
||||
rt.position = pos;
|
||||
|
||||
Vector3[] rtCorners = new Vector3[4];
|
||||
rt.GetWorldCorners(rtCorners);
|
||||
rt.position = originalPos;
|
||||
|
||||
// Documentation text normalized.
|
||||
return rtCorners[0].x < canvasLeft || rtCorners[2].x > canvasRight ||
|
||||
rtCorners[0].y < canvasBottom || rtCorners[2].y > canvasTop;
|
||||
}
|
||||
|
||||
private Vector2 CalculateDynamicOffset()
|
||||
{
|
||||
// Documentation text normalized.
|
||||
float screenWidth = Screen.width;
|
||||
float screenHeight = Screen.height;
|
||||
|
||||
// Documentation text normalized.
|
||||
Vector2 percentOffset = new Vector2(
|
||||
screenWidth * offsetPercent.x,
|
||||
screenHeight * offsetPercent.y
|
||||
);
|
||||
|
||||
// Documentation text normalized.
|
||||
if (isAbove)
|
||||
{
|
||||
percentOffset.y = -percentOffset.y;
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
Vector2 finalOffset = new Vector2(
|
||||
Mathf.Abs(percentOffset.x) > Mathf.Abs(minOffsetPixels.x) ? percentOffset.x : minOffsetPixels.x,
|
||||
Mathf.Abs(percentOffset.y) > Mathf.Abs(minOffsetPixels.y) ? percentOffset.y : minOffsetPixels.y
|
||||
);
|
||||
|
||||
// Documentation text normalized.
|
||||
if (isAbove)
|
||||
{
|
||||
finalOffset.y = Mathf.Abs(finalOffset.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
finalOffset.y = -Mathf.Abs(finalOffset.y);
|
||||
}
|
||||
|
||||
return finalOffset;
|
||||
return rtCorners[0].x < canvasLeft ||
|
||||
rtCorners[2].x > canvasRight ||
|
||||
rtCorners[0].y < canvasBottom ||
|
||||
rtCorners[2].y > canvasTop;
|
||||
}
|
||||
|
||||
private Canvas GetCanvas()
|
||||
@@ -330,44 +318,93 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
if (detailsParent != null)
|
||||
{
|
||||
Canvas parentCanvas = detailsParent.GetComponentInParent<Canvas>();
|
||||
if (parentCanvas != null) return parentCanvas;
|
||||
if (parentCanvas != null)
|
||||
{
|
||||
return parentCanvas;
|
||||
}
|
||||
}
|
||||
|
||||
Canvas selfCanvas = GetComponentInParent<Canvas>();
|
||||
if (selfCanvas != null) return selfCanvas;
|
||||
if (selfCanvas != null)
|
||||
{
|
||||
return selfCanvas;
|
||||
}
|
||||
|
||||
return SceneObjectLookupCache.FindAny<Canvas>();
|
||||
}
|
||||
|
||||
private Camera GetCanvasEventCamera(Canvas canvas)
|
||||
{
|
||||
if (canvas == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera;
|
||||
}
|
||||
|
||||
private void RebuildDetailsLayout(RectTransform rt)
|
||||
{
|
||||
if (rt == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Canvas.ForceUpdateCanvases();
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(rt);
|
||||
}
|
||||
|
||||
private void AdjustPositionWithinCanvas(RectTransform rt, Canvas canvas)
|
||||
{
|
||||
if (rt == null || canvas == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RectTransform canvasRect = canvas.GetComponent<RectTransform>();
|
||||
Vector3[] rtCorners = new Vector3[4];
|
||||
Vector3[] canvasCorners = new Vector3[4];
|
||||
|
||||
rt.GetWorldCorners(rtCorners);
|
||||
canvasRect.GetWorldCorners(canvasCorners);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
RebuildDetailsLayout(rt);
|
||||
rt.GetWorldCorners(rtCorners);
|
||||
canvasRect.GetWorldCorners(canvasCorners);
|
||||
|
||||
float canvasLeft = canvasCorners[0].x;
|
||||
float canvasRight = canvasCorners[2].x;
|
||||
float canvasBottom = canvasCorners[0].y;
|
||||
float canvasTop = canvasCorners[2].y;
|
||||
float canvasLeft = canvasCorners[0].x;
|
||||
float canvasRight = canvasCorners[2].x;
|
||||
float canvasBottom = canvasCorners[0].y;
|
||||
float canvasTop = canvasCorners[2].y;
|
||||
|
||||
Vector3 adjustedPos = rt.position;
|
||||
Vector3 delta = Vector3.zero;
|
||||
|
||||
// Documentation text normalized.
|
||||
if (rtCorners[2].x > canvasRight)
|
||||
adjustedPos.x -= (rtCorners[2].x - canvasRight);
|
||||
if (rtCorners[0].x < canvasLeft)
|
||||
adjustedPos.x += (canvasLeft - rtCorners[0].x);
|
||||
if (rtCorners[2].x > canvasRight)
|
||||
{
|
||||
delta.x -= rtCorners[2].x - canvasRight;
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
if (rtCorners[2].y > canvasTop)
|
||||
adjustedPos.y -= (rtCorners[2].y - canvasTop);
|
||||
if (rtCorners[0].y < canvasBottom)
|
||||
adjustedPos.y += (canvasBottom - rtCorners[0].y);
|
||||
if (rtCorners[0].x < canvasLeft)
|
||||
{
|
||||
delta.x += canvasLeft - rtCorners[0].x;
|
||||
}
|
||||
|
||||
rt.position = adjustedPos;
|
||||
if (rtCorners[2].y > canvasTop)
|
||||
{
|
||||
delta.y -= rtCorners[2].y - canvasTop;
|
||||
}
|
||||
|
||||
if (rtCorners[0].y < canvasBottom)
|
||||
{
|
||||
delta.y += canvasBottom - rtCorners[0].y;
|
||||
}
|
||||
|
||||
if (delta.sqrMagnitude <= 0.0001f)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
rt.position += delta;
|
||||
}
|
||||
}
|
||||
|
||||
public void HideDetails()
|
||||
@@ -392,7 +429,7 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator PlayEnterAnimation(RectTransform rt, CanvasGroup cg)
|
||||
private IEnumerator PlayEnterAnimation(RectTransform rt, CanvasGroup cg)
|
||||
{
|
||||
if (rt == null || cg == null)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,9 @@ using System.Linq;
|
||||
|
||||
public class loadSkillsSelect : MonoBehaviour
|
||||
{
|
||||
private const string HiddenSkillName = "未解锁技能";
|
||||
private const string HiddenSkillDescription = "此技能尚未解锁。";
|
||||
|
||||
public static loadSkillsSelect Instance { get; private set; }
|
||||
|
||||
[Header("Prefab / UI")]
|
||||
@@ -13,22 +16,27 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
public GameObject columnHeaderPrefab; // optional prefab for column headers, e.g. Text or UI element with Text component
|
||||
|
||||
[Header("Column Layout Settings")]
|
||||
public float columnSpacing = 10f; // Spacing between items in a column
|
||||
public float columnWidth = 200f; // Documentation text normalized.
|
||||
public float columnPosX = 0f; // Documentation text normalized.
|
||||
public TextAnchor columnChildAlignment = TextAnchor.MiddleLeft; // Alignment of children in the column
|
||||
public bool columnChildControlWidth = false; // Whether to control child width
|
||||
public bool columnChildControlHeight = false; // Whether to control child height
|
||||
public bool columnChildScaleWidth = false; // Whether to use child scale width
|
||||
public bool columnChildScaleHeight = false; // Whether to use child scale height
|
||||
public bool columnChildForceExpandWidth = false; // Whether to force expand width
|
||||
public bool columnChildForceExpandHeight = false; // Whether to force expand height
|
||||
public int columnPaddingLeft = 0; // Left padding for the column
|
||||
public int columnPaddingRight = 0; // Right padding for the column
|
||||
public int columnPaddingTop = 0; // Top padding for the column
|
||||
public int columnPaddingBottom = 0; // Bottom padding for the column
|
||||
public float columnVerticalSpacing = 10f; // Vertical spacing between header and skills in a column
|
||||
|
||||
[Header("Skill Group Container Settings")]
|
||||
public Vector2 skillGroupCellSize = new Vector2(180f, 120f);
|
||||
public Vector2 skillGroupSpacing = new Vector2(10f, 10f);
|
||||
public GridLayoutGroup.Corner skillGroupStartCorner = GridLayoutGroup.Corner.UpperLeft;
|
||||
public GridLayoutGroup.Axis skillGroupStartAxis = GridLayoutGroup.Axis.Horizontal;
|
||||
public TextAnchor skillGroupChildAlignment = TextAnchor.UpperLeft;
|
||||
public GridLayoutGroup.Constraint skillGroupConstraint = GridLayoutGroup.Constraint.Flexible;
|
||||
public int skillGroupConstraintCount = 2;
|
||||
public int skillGroupPaddingLeft = 0;
|
||||
public int skillGroupPaddingRight = 0;
|
||||
public int skillGroupPaddingTop = 0;
|
||||
public int skillGroupPaddingBottom = 0;
|
||||
|
||||
[Header("Skill Group Content Size Fitter")]
|
||||
public ContentSizeFitter.FitMode skillGroupHorizontalFit = ContentSizeFitter.FitMode.Unconstrained;
|
||||
public ContentSizeFitter.FitMode skillGroupVerticalFit = ContentSizeFitter.FitMode.PreferredSize;
|
||||
|
||||
[Header("Skill Card Layout Settings")]
|
||||
public bool skillCardUseLayoutElement = true; // Whether to add LayoutElement to skill cards
|
||||
public bool skillCardControlPreferredWidth = false;
|
||||
@@ -134,8 +142,10 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
}
|
||||
|
||||
found.LoadEquippedSkillsFromLocal();
|
||||
currentHeroSO = found; // Documentation text normalized.
|
||||
// Documentation text normalized.
|
||||
currentHeroSO = found;
|
||||
bool revealLockedSkills = PlayerSkillService.IsRevealLockedSkillsEnabled();
|
||||
var levelInfo = found.GetEffectiveLevelForCurrentEXP();
|
||||
int currentLevelId = levelInfo != null ? levelInfo.levelID : 0;
|
||||
var groupsByColumn = new System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<SkillGroup>>();
|
||||
foreach (var g in found.skillGroups)
|
||||
{
|
||||
@@ -144,7 +154,6 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
groupsByColumn[g.columnID].Add(g);
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
var sortedColumns = groupsByColumn.Keys.ToList();
|
||||
sortedColumns.Sort();
|
||||
|
||||
@@ -154,7 +163,6 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
var columnGroups = groupsByColumn[colId];
|
||||
var columnName = columnGroups.Count > 0 ? columnGroups[0].columnName : $"Column {colId}";
|
||||
|
||||
// Documentation text normalized.
|
||||
string displayColumnName = columnName;
|
||||
if (!string.IsNullOrEmpty(columnName))
|
||||
{
|
||||
@@ -166,62 +174,53 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
var columnContainer = new GameObject($"Column_{colId}", typeof(RectTransform));
|
||||
columnContainer.transform.SetParent(contentParent, false);
|
||||
|
||||
// Documentation text normalized.
|
||||
RectTransform colRt = columnContainer.GetComponent<RectTransform>();
|
||||
colRt.sizeDelta = new Vector2(columnWidth, colRt.sizeDelta.y);
|
||||
colRt.anchoredPosition = new Vector2(columnPosX, colRt.anchoredPosition.y);
|
||||
|
||||
var vlg = columnContainer.AddComponent<UnityEngine.UI.VerticalLayoutGroup>();
|
||||
vlg.spacing = columnVerticalSpacing; // Documentation text normalized.
|
||||
vlg.childAlignment = TextAnchor.UpperLeft; // Documentation text normalized.
|
||||
vlg.childControlWidth = true; // Documentation text normalized.
|
||||
vlg.childControlHeight = false; // Documentation text normalized.
|
||||
vlg.childForceExpandWidth = false; // Documentation text normalized.
|
||||
vlg.childForceExpandHeight = false; // Documentation text normalized.
|
||||
|
||||
// Documentation text normalized.
|
||||
if (columnHeaderPrefab != null)
|
||||
{
|
||||
var headerGo = Instantiate(columnHeaderPrefab, columnContainer.transform);
|
||||
var text = headerGo.GetComponent<Text>();
|
||||
if (text != null)
|
||||
var headerGo = Instantiate(columnHeaderPrefab, contentParent.transform);
|
||||
RectTransform headerRect = headerGo.GetComponent<RectTransform>();
|
||||
if (headerRect != null)
|
||||
{
|
||||
text.text = displayColumnName;
|
||||
headerRect.sizeDelta = new Vector2(columnWidth, headerRect.sizeDelta.y);
|
||||
headerRect.anchoredPosition = new Vector2(columnPosX, headerRect.anchoredPosition.y);
|
||||
}
|
||||
|
||||
var heroSkillColumnText = headerGo.GetComponent<heroSkill_columnText>() ?? headerGo.GetComponentInChildren<heroSkill_columnText>(true);
|
||||
if (heroSkillColumnText != null)
|
||||
{
|
||||
heroSkillColumnText.SetColumnText(displayColumnName);
|
||||
}
|
||||
else
|
||||
{
|
||||
var tmpText = headerGo.GetComponent<TMPro.TextMeshProUGUI>();
|
||||
if (tmpText != null)
|
||||
var text = headerGo.GetComponent<Text>() ?? headerGo.GetComponentInChildren<Text>(true);
|
||||
if (text != null)
|
||||
{
|
||||
tmpText.text = displayColumnName;
|
||||
text.text = displayColumnName;
|
||||
}
|
||||
else
|
||||
{
|
||||
var tmpText = headerGo.GetComponent<TMPro.TextMeshProUGUI>() ?? headerGo.GetComponentInChildren<TMPro.TextMeshProUGUI>(true);
|
||||
if (tmpText != null)
|
||||
{
|
||||
tmpText.text = displayColumnName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
var skillsContainer = new GameObject("SkillsContainer");
|
||||
skillsContainer.transform.SetParent(columnContainer.transform, false);
|
||||
var hlg = skillsContainer.AddComponent<UnityEngine.UI.HorizontalLayoutGroup>();
|
||||
hlg.spacing = columnSpacing; // Documentation text normalized.
|
||||
hlg.childAlignment = columnChildAlignment; // Documentation text normalized.
|
||||
hlg.childControlWidth = columnChildControlWidth; // Documentation text normalized.
|
||||
hlg.childControlHeight = columnChildControlHeight; // Documentation text normalized.
|
||||
hlg.childScaleWidth = columnChildScaleWidth;
|
||||
hlg.childScaleHeight = columnChildScaleHeight;
|
||||
hlg.childForceExpandWidth = columnChildForceExpandWidth;
|
||||
hlg.childForceExpandHeight = columnChildForceExpandHeight;
|
||||
hlg.padding = new UnityEngine.RectOffset(columnPaddingLeft, columnPaddingRight, columnPaddingTop, columnPaddingBottom); // Documentation text normalized.
|
||||
var skillGroupContainer = new GameObject("SkillGroupContainer", typeof(RectTransform));
|
||||
skillGroupContainer.transform.SetParent(contentParent.transform, false);
|
||||
RectTransform skillGroupRect = skillGroupContainer.GetComponent<RectTransform>();
|
||||
if (skillGroupRect != null)
|
||||
{
|
||||
skillGroupRect.sizeDelta = new Vector2(columnWidth, skillGroupRect.sizeDelta.y);
|
||||
skillGroupRect.anchoredPosition = new Vector2(columnPosX, skillGroupRect.anchoredPosition.y - columnVerticalSpacing);
|
||||
}
|
||||
ConfigureSkillGroupContainer(skillGroupContainer);
|
||||
|
||||
// Documentation text normalized.
|
||||
foreach (var g in columnGroups)
|
||||
{
|
||||
if (g == null) continue;
|
||||
var go = Instantiate(skillCardPrefab, skillsContainer.transform);
|
||||
// populate as before
|
||||
var go = Instantiate(skillCardPrefab, skillGroupContainer.transform);
|
||||
var s = go.GetComponent<slots_skillSlots>();
|
||||
if (s == null)
|
||||
{
|
||||
@@ -229,27 +228,27 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
continue;
|
||||
}
|
||||
|
||||
// populate fields
|
||||
if (s.skillCard_skillName != null) s.skillCard_skillName.text = g.groupName ?? string.Empty;
|
||||
bool unlocked = currentLevelId >= Mathf.Clamp(g.thisSkill_levelLimit, 1, 4);
|
||||
bool shouldMaskSkill = !revealLockedSkills && !unlocked;
|
||||
string displayName = shouldMaskSkill ? HiddenSkillName : (g.groupName ?? string.Empty);
|
||||
string displayDescription = shouldMaskSkill ? HiddenSkillDescription : (g.skillDescriptionsText ?? string.Empty);
|
||||
|
||||
if (s.skillCard_skillName != null) s.skillCard_skillName.text = displayName;
|
||||
s.skillCard_skillID = g.skillGroupID;
|
||||
if (s.skillCard_skillIconImage != null)
|
||||
{
|
||||
s.skillCard_skillIconImage.sprite = g.groupIcon;
|
||||
s.skillCard_skillIconImage.color = g.groupIcon != null ? new Color(1f,1f,1f,1f) : new Color(1f,1f,1f,0f);
|
||||
}
|
||||
s.skillCard_skillDescription = g.skillDescriptionsText ?? string.Empty;
|
||||
s.skillCard_skillDescription = displayDescription;
|
||||
|
||||
// set hero ID
|
||||
s.heroId = heroId;
|
||||
|
||||
// set initial selection state to false (not selected by default)
|
||||
s.isSelected = false;
|
||||
s.ApplyState();
|
||||
|
||||
// set skill card to read-only mode
|
||||
s.isReadOnly = true;
|
||||
|
||||
// Add or configure LayoutElement if enabled
|
||||
if (skillCardUseLayoutElement)
|
||||
{
|
||||
var le = go.GetComponent<UnityEngine.UI.LayoutElement>() ?? go.AddComponent<UnityEngine.UI.LayoutElement>();
|
||||
@@ -261,11 +260,9 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
if (skillCardControlMinHeight) le.minHeight = skillCardMinHeight;
|
||||
}
|
||||
|
||||
// use the existing Button component on the skill card
|
||||
if (s.skillCard_button != null)
|
||||
{
|
||||
s.skillCard_button.onClick.RemoveAllListeners();
|
||||
// capture local reference to slots component for closure
|
||||
var localS = s;
|
||||
s.skillCard_button.onClick.AddListener(() => {
|
||||
if (localS == null) return;
|
||||
@@ -283,22 +280,40 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
|
||||
Debug.Log($"loadSkillsSelect: instantiated {created} skill cards for heroId={heroId}");
|
||||
|
||||
// Update skill card selections based on equipped groups
|
||||
UpdateSkillCardSelections();
|
||||
}
|
||||
|
||||
private void ConfigureSkillGroupContainer(GameObject skillGroupContainer)
|
||||
{
|
||||
if (skillGroupContainer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var grid = skillGroupContainer.GetComponent<GridLayoutGroup>() ?? skillGroupContainer.AddComponent<GridLayoutGroup>();
|
||||
grid.cellSize = skillGroupCellSize;
|
||||
grid.spacing = skillGroupSpacing;
|
||||
grid.startCorner = skillGroupStartCorner;
|
||||
grid.startAxis = skillGroupStartAxis;
|
||||
grid.childAlignment = skillGroupChildAlignment;
|
||||
grid.constraint = skillGroupConstraint;
|
||||
grid.constraintCount = Mathf.Max(1, skillGroupConstraintCount);
|
||||
grid.padding = new RectOffset(skillGroupPaddingLeft, skillGroupPaddingRight, skillGroupPaddingTop, skillGroupPaddingBottom);
|
||||
|
||||
var fitter = skillGroupContainer.GetComponent<ContentSizeFitter>() ?? skillGroupContainer.AddComponent<ContentSizeFitter>();
|
||||
fitter.horizontalFit = skillGroupHorizontalFit;
|
||||
fitter.verticalFit = skillGroupVerticalFit;
|
||||
}
|
||||
|
||||
public void UpdateSkillCardSelections()
|
||||
{
|
||||
if (currentHeroSO == null || contentParent == null) return;
|
||||
|
||||
// Defensive: handle null equipped list
|
||||
var equippedIds = currentHeroSO.equippedSkillGroupIDs ?? new int[0];
|
||||
var equipped = new System.Collections.Generic.HashSet<int>(equippedIds);
|
||||
|
||||
// Ensure layout is rebuilt so all instantiated children are available and their LayoutElements applied
|
||||
UnityEngine.UI.LayoutRebuilder.ForceRebuildLayoutImmediate(contentParent);
|
||||
|
||||
// Get all slots under contentParent (including nested containers and inactive objects)
|
||||
var slots = contentParent.GetComponentsInChildren<slots_skillSlots>(true);
|
||||
if (slots == null || slots.Length == 0) return;
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ public class loadTeam_select : MonoBehaviour
|
||||
{
|
||||
var so = found[i];
|
||||
if (so == null) continue;
|
||||
if (!so.isUnlocked) continue;
|
||||
var go = Instantiate(roleCardPrefab, contentParent);
|
||||
go.transform.SetParent(contentParent, false);
|
||||
var ctrl = go.GetComponent<roleCard_prefabController>();
|
||||
@@ -117,16 +118,8 @@ public class loadTeam_select : MonoBehaviour
|
||||
if (ctrl.roleCard_heroProfile != null) ctrl.roleCard_heroProfile.sprite = so.ally_heroSelectIcon;
|
||||
if (ctrl.roleCard_heroName != null) ctrl.roleCard_heroName.text = so.ally_heroName;
|
||||
ctrl.roleCard_heroID = so.ally_heroID;
|
||||
|
||||
// compute effective rating (S/A/B/C) based on current EXP and levelStats
|
||||
string rating = GetRatingFromSO(so); // returns "S","A","B","C"
|
||||
|
||||
int colorIdx = MapLevelNameToColorIndex(rating);
|
||||
colorIdx = Mathf.Clamp(colorIdx, 0, ctrl.bottomImage_colors.Length - 1);
|
||||
if (ctrl.roleCard_bottomImage != null && ctrl.bottomImage_colors != null && ctrl.bottomImage_colors.Length > colorIdx)
|
||||
{
|
||||
ctrl.roleCard_bottomImage.color = ctrl.bottomImage_colors[colorIdx];
|
||||
}
|
||||
ctrl.heroSO = so;
|
||||
ctrl.RefreshLevelImage();
|
||||
|
||||
// Documentation text normalized.
|
||||
if (i % 2 == 0)
|
||||
@@ -136,59 +129,6 @@ public class loadTeam_select : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Map the effective level determined by ally_currentEXP to one of S/A/B/C
|
||||
private string GetRatingFromSO(AllyHero_SO so)
|
||||
{
|
||||
if (so == null || so.levelStats == null || so.levelStats.Count == 0) return "C";
|
||||
|
||||
// Build a sorted copy by requiredEXP ascending
|
||||
List<AllyHero_SO.AllyLevelInfo> sorted = new List<AllyHero_SO.AllyLevelInfo>();
|
||||
foreach (var l in so.levelStats) if (l != null) sorted.Add(l);
|
||||
sorted.Sort((a, b) => a.requiredEXP.CompareTo(b.requiredEXP));
|
||||
|
||||
int currentExp = so.ally_currentEXP;
|
||||
int selectedIndex = 0;
|
||||
for (int i = 0; i < sorted.Count; i++)
|
||||
{
|
||||
if (currentExp >= sorted[i].requiredEXP)
|
||||
{
|
||||
selectedIndex = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Map indices to ratings: index 0 -> C, 1 -> B, 2 -> A, 3+ -> S
|
||||
if (selectedIndex <= 0) return "C";
|
||||
if (selectedIndex == 1) return "B";
|
||||
if (selectedIndex == 2) return "A";
|
||||
// for selectedIndex >= 3 (including when there are more than 4 levels), treat as S
|
||||
return "S";
|
||||
}
|
||||
|
||||
private int MapLevelNameToColorIndex(string levelName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(levelName)) return 3; // default to last color
|
||||
// common convention: S/A/B/C
|
||||
switch (levelName.ToUpper())
|
||||
{
|
||||
case "S": return 0; // red
|
||||
case "A": return 1; // green
|
||||
case "B": return 2; // blue
|
||||
case "C": return 3; // yellow
|
||||
default:
|
||||
// try parse first char
|
||||
char c = levelName.ToUpper()[0];
|
||||
if (c == 'S') return 0;
|
||||
if (c == 'A') return 1;
|
||||
if (c == 'B') return 2;
|
||||
if (c == 'C') return 3;
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
@@ -10,6 +10,8 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
public Text roleCard_heroName;
|
||||
public Image roleCard_bottomImage;
|
||||
public Image boarder_img;
|
||||
public Image thisHero_levelImage;
|
||||
[SerializeField] Sprite[] heroLevelImage;
|
||||
public int roleCard_heroID;
|
||||
[Header("SO Reference")]
|
||||
[SerializeField] public AllyHero_SO heroSO; // Documentation text normalized.
|
||||
@@ -35,6 +37,8 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
heroSO = FindAllyHeroSOById(roleCard_heroID);
|
||||
}
|
||||
|
||||
RefreshLevelImage();
|
||||
|
||||
// Initialize boarder alpha to 0 (hidden)
|
||||
if (boarder_img != null)
|
||||
{
|
||||
@@ -106,6 +110,7 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
}
|
||||
if (roleCard_heroName != null)
|
||||
roleCard_heroName.text = foundSO.ally_heroName;
|
||||
RefreshLevelImage();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,6 +122,7 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
}
|
||||
if (roleCard_heroName != null && sourceCard != null && sourceCard.characterImage != null)
|
||||
roleCard_heroName.text = sourceCard.characterImage.gameObject.name;
|
||||
ApplyLevelSpriteByRating(null);
|
||||
}
|
||||
|
||||
// set TeamManager selected card for potential slot placement
|
||||
@@ -139,6 +145,94 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
return null;
|
||||
}
|
||||
|
||||
public void RefreshLevelImage()
|
||||
{
|
||||
if (heroSO == null && roleCard_heroID > 0)
|
||||
{
|
||||
heroSO = FindAllyHeroSOById(roleCard_heroID);
|
||||
}
|
||||
|
||||
string rating = heroSO != null ? GetRatingFromSO(heroSO) : null;
|
||||
ApplyLevelSpriteByRating(rating);
|
||||
}
|
||||
|
||||
private void ApplyLevelSpriteByRating(string rating)
|
||||
{
|
||||
if (thisHero_levelImage == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Sprite sprite = null;
|
||||
int spriteIndex = GetLevelSpriteIndex(rating);
|
||||
if (heroLevelImage != null && spriteIndex >= 0 && spriteIndex < heroLevelImage.Length)
|
||||
{
|
||||
sprite = heroLevelImage[spriteIndex];
|
||||
}
|
||||
|
||||
thisHero_levelImage.sprite = sprite;
|
||||
Color color = thisHero_levelImage.color;
|
||||
color.a = sprite != null ? 1f : 0f;
|
||||
thisHero_levelImage.color = color;
|
||||
}
|
||||
|
||||
private int GetLevelSpriteIndex(string rating)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(rating))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (rating.ToUpper())
|
||||
{
|
||||
case "C":
|
||||
return 0;
|
||||
case "B":
|
||||
return 1;
|
||||
case "A":
|
||||
return 2;
|
||||
case "S":
|
||||
return 3;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetRatingFromSO(AllyHero_SO so)
|
||||
{
|
||||
if (so == null || so.levelStats == null || so.levelStats.Count == 0) return "C";
|
||||
|
||||
var sorted = new System.Collections.Generic.List<AllyHero_SO.AllyLevelInfo>();
|
||||
foreach (var level in so.levelStats)
|
||||
{
|
||||
if (level != null)
|
||||
{
|
||||
sorted.Add(level);
|
||||
}
|
||||
}
|
||||
|
||||
sorted.Sort((left, right) => left.requiredEXP.CompareTo(right.requiredEXP));
|
||||
|
||||
int currentExp = so.ally_currentEXP;
|
||||
int selectedIndex = 0;
|
||||
for (int i = 0; i < sorted.Count; i++)
|
||||
{
|
||||
if (currentExp >= sorted[i].requiredEXP)
|
||||
{
|
||||
selectedIndex = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedIndex <= 0) return "C";
|
||||
if (selectedIndex == 1) return "B";
|
||||
if (selectedIndex == 2) return "A";
|
||||
return "S";
|
||||
}
|
||||
|
||||
// ---------------- Drag implementation so roleCard entries can be dragged as source ----------------
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
@@ -148,6 +242,11 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
heroSO = FindAllyHeroSOById(roleCard_heroID);
|
||||
}
|
||||
|
||||
if (heroSO != null && !heroSO.isUnlocked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (roleCard_heroProfile == null || roleCard_heroProfile.sprite == null) return;
|
||||
if (rootCanvas == null) rootCanvas = GetComponentInParent<Canvas>();
|
||||
if (rootCanvas == null) return;
|
||||
|
||||
@@ -35,7 +35,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: 80, y: 110}
|
||||
m_SizeDelta: {x: 120, y: 156}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &461699305662949504
|
||||
CanvasRenderer:
|
||||
@@ -65,8 +65,8 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: 41afe6284aa236e4997e85de3b44845f, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
@@ -102,15 +102,15 @@ RectTransform:
|
||||
m_GameObject: {fileID: 859021744337597420}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.975, y: 0.975, z: 0.975}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4338117946548508397}
|
||||
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: 80, y: 110}
|
||||
m_SizeDelta: {x: 100, y: 136}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6400986566778129659
|
||||
CanvasRenderer:
|
||||
@@ -140,8 +140,8 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: 3e7442e3c57b384478a09c6113d83e11, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
@@ -179,13 +179,14 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 6861905243163497001}
|
||||
m_Father: {fileID: 4338117946548508397}
|
||||
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.000035524, y: -41.1857}
|
||||
m_SizeDelta: {x: 80, y: 23.8915}
|
||||
m_AnchoredPosition: {x: 5.0002, y: -51.544}
|
||||
m_SizeDelta: {x: 110, y: 32.9121}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5032615943064818915
|
||||
CanvasRenderer:
|
||||
@@ -208,14 +209,14 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.7254902}
|
||||
m_Color: {r: 0, g: 0, b: 0, 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: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 0f40f53c19cdeda4ea9f179d70e26bed, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -260,7 +261,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: 90, y: 120}
|
||||
m_SizeDelta: {x: 144, y: 180}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2958198797774627574
|
||||
CanvasRenderer:
|
||||
@@ -283,15 +284,15 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.33962262, g: 0.33962262, b: 0.33962262, a: 1}
|
||||
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: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: db2acbae862f4b04eb4f590fd44f8c79, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 0
|
||||
m_FillMethod: 4
|
||||
@@ -325,17 +326,17 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4597467304780993393}
|
||||
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: []
|
||||
m_Father: {fileID: 4338117946548508397}
|
||||
m_Father: {fileID: 4390366643510161075}
|
||||
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: -40}
|
||||
m_SizeDelta: {x: 100, y: 30}
|
||||
m_AnchoredPosition: {x: -2, y: 0}
|
||||
m_SizeDelta: {x: 102.9645, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2404628554404299183
|
||||
CanvasRenderer:
|
||||
@@ -367,18 +368,93 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: cc180dff846d13a4d88ddaed6f77e5cd, type: 3}
|
||||
m_FontSize: 15
|
||||
m_FontSize: 16
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_Alignment: 3
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u540D\u5B57\u4E94\u4E2A\u5B57"
|
||||
m_Text: "\u540D\u5B57\u6709\u4E94\u4E2A\u5B57"
|
||||
--- !u!1 &4749977904386664373
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9038593337767502807}
|
||||
- component: {fileID: 1537147076042653775}
|
||||
- component: {fileID: 1919978641201851518}
|
||||
m_Layer: 0
|
||||
m_Name: roleCard_heroLevel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9038593337767502807
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4749977904386664373}
|
||||
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: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4338117946548508397}
|
||||
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: 40, y: 57}
|
||||
m_SizeDelta: {x: 27.5, y: 31.5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1537147076042653775
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4749977904386664373}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1919978641201851518
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4749977904386664373}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
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: 21300000, guid: bd8baf249026a2241be3632c1212270c, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 0
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 5
|
||||
--- !u!1 &7166236678367441549
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -412,7 +488,7 @@ RectTransform:
|
||||
- {fileID: 929967515644738485}
|
||||
- {fileID: 4310679903645723474}
|
||||
- {fileID: 4390366643510161075}
|
||||
- {fileID: 6861905243163497001}
|
||||
- {fileID: 9038593337767502807}
|
||||
- {fileID: 2577293105028380878}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -437,6 +513,12 @@ MonoBehaviour:
|
||||
roleCard_heroName: {fileID: 2207459034629670508}
|
||||
roleCard_bottomImage: {fileID: 3496424667454847875}
|
||||
boarder_img: {fileID: 2598562773452762772}
|
||||
thisHero_levelImage: {fileID: 1919978641201851518}
|
||||
heroLevelImage:
|
||||
- {fileID: 21300000, guid: bd8baf249026a2241be3632c1212270c, type: 3}
|
||||
- {fileID: 21300000, guid: 85de9953e28e90a4095f1bc57993d495, type: 3}
|
||||
- {fileID: 21300000, guid: d8885e3f28c76d1488a7f55c3c13510a, type: 3}
|
||||
- {fileID: 21300000, guid: a2db4e2865b8b7c4f9e8e3d675ea1526, type: 3}
|
||||
roleCard_heroID: 0
|
||||
heroSO: {fileID: 0}
|
||||
bottomImage_colors:
|
||||
|
||||
@@ -249,10 +249,10 @@ RectTransform:
|
||||
- {fileID: 4688030792267625363}
|
||||
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_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: 0}
|
||||
m_SizeDelta: {x: 120, y: 35}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1290595309408241639
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -67,7 +67,7 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: cc180dff846d13a4d88ddaed6f77e5cd, type: 3}
|
||||
m_FontSize: 18
|
||||
m_FontSize: 20
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 1
|
||||
@@ -113,10 +113,10 @@ RectTransform:
|
||||
- {fileID: 1476567720918343532}
|
||||
m_Father: {fileID: 1069940504772234767}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 99.999985, y: 28.100006}
|
||||
m_SizeDelta: {x: 180, y: 30.8408}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -1.7699966, y: -352.6}
|
||||
m_SizeDelta: {x: 180, y: 30.84079}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7623010645365366267
|
||||
CanvasRenderer:
|
||||
@@ -139,15 +139,15 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.36078432}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_Sprite: {fileID: 21300000, guid: 0f40f53c19cdeda4ea9f179d70e26bed, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
@@ -169,6 +169,81 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ShowMaskGraphic: 1
|
||||
--- !u!1 &2413482278320928737
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2713257091501715371}
|
||||
- component: {fileID: 5846360826326367240}
|
||||
- component: {fileID: 2823492194566047176}
|
||||
m_Layer: 0
|
||||
m_Name: lvlImage shadow
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2713257091501715371
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2413482278320928737}
|
||||
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: 505709450491090271}
|
||||
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: 21.3, y: -391.5}
|
||||
m_SizeDelta: {x: 52, y: 63}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5846360826326367240
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2413482278320928737}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2823492194566047176
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2413482278320928737}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.87058824}
|
||||
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: 21300000, guid: a2db4e2865b8b7c4f9e8e3d675ea1526, 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 &2696693463715882529
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -199,13 +274,12 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1160540157065071911}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 505709450491090271}
|
||||
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: 45.5, y: 243.3}
|
||||
m_AnchoredPosition: {x: 28.3, y: 303.3}
|
||||
m_SizeDelta: {x: 40, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4682973529626813325
|
||||
@@ -236,7 +310,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Sprite: {fileID: 21300000, guid: ff6a2bcff7a68d045b2be942b8eb6845, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -323,12 +397,13 @@ RectTransform:
|
||||
- {fileID: 1069940504772234767}
|
||||
- {fileID: 2481977685806833048}
|
||||
- {fileID: 5963241098399977379}
|
||||
- {fileID: 2713257091501715371}
|
||||
- {fileID: 6916506249471759434}
|
||||
- {fileID: 6919908692958857229}
|
||||
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_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
@@ -350,21 +425,29 @@ MonoBehaviour:
|
||||
heroSlot_heroName: {fileID: 6582694595630630883}
|
||||
heroImage: {fileID: 8101079333985013449}
|
||||
heroLevelImage: {fileID: 937097627106398845}
|
||||
heroLevelImage_shadow: {fileID: 2823492194566047176}
|
||||
thisHero_detail_displayButton: {fileID: 1089004877857606799}
|
||||
thisHero_detial_panelObject: {fileID: 3721889475878020754, guid: 59dfd4ddf9533f644aefd71f3260a05c, type: 3}
|
||||
defaultHeroSprite: {fileID: 21300000, guid: bcecb54d88e46bd4892ad95e1d63eb1f, type: 3}
|
||||
defaultBottomImage: {fileID: 6680939226128776059}
|
||||
headerImage_colors:
|
||||
- {r: 1, g: 1, b: 1, a: 1}
|
||||
- {r: 1, g: 1, b: 1, a: 1}
|
||||
- {r: 1, g: 1, b: 1, a: 1}
|
||||
- {r: 1, g: 1, b: 1, a: 1}
|
||||
- {r: 1, g: 1, b: 1, a: 1}
|
||||
slotDefaultImage:
|
||||
- {fileID: 21300000, guid: 58a5a923a40522c4e88e21f707b86f40, type: 3}
|
||||
- {fileID: 21300000, guid: 98ce485da2181f4478e220c65c4deb88, type: 3}
|
||||
- {fileID: 21300000, guid: 9a4b74a66c7c664418addc9da47985da, type: 3}
|
||||
- {fileID: 21300000, guid: 4d07c60dfa2c76144b6eedcfd996fdca, type: 3}
|
||||
- {fileID: 21300000, guid: 87d4451de9d304b4daf8a706a8160010, type: 3}
|
||||
skillContainer: {fileID: 3121310117852151690}
|
||||
skillCardPrefab: {fileID: 6849663232819926772, guid: cd57e902147b2744ea30e7e412013adc, type: 3}
|
||||
levelIcon_sprite_C: {fileID: 21300000, guid: d7eaba65838aec845b770f1a9033c3b6, type: 3}
|
||||
levelIcon_sprite_B: {fileID: 21300000, guid: ebccb100e69d1a14884e51d82092e302, type: 3}
|
||||
levelIcon_sprite_A: {fileID: 21300000, guid: 58776b180e054d949814089d45f8d678, type: 3}
|
||||
levelIcon_sprite_S: {fileID: 21300000, guid: ecd7a8694457df64687ae6b57ab1fa44, type: 3}
|
||||
levelIcon_sprite_C: {fileID: 21300000, guid: bd8baf249026a2241be3632c1212270c, type: 3}
|
||||
levelIcon_sprite_B: {fileID: 21300000, guid: 85de9953e28e90a4095f1bc57993d495, type: 3}
|
||||
levelIcon_sprite_A: {fileID: 21300000, guid: d8885e3f28c76d1488a7f55c3c13510a, type: 3}
|
||||
levelIcon_sprite_S: {fileID: 21300000, guid: a2db4e2865b8b7c4f9e8e3d675ea1526, type: 3}
|
||||
enableHoverAnim: 1
|
||||
hoverScale: 1.04
|
||||
hoverTweenTime: 0.12
|
||||
@@ -481,8 +564,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: 16.818, y: -316.8183}
|
||||
m_SizeDelta: {x: 96.675, y: 96.675}
|
||||
m_AnchoredPosition: {x: 20.6, y: -387.5}
|
||||
m_SizeDelta: {x: 52, y: 63}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7029393728006405258
|
||||
CanvasRenderer:
|
||||
@@ -512,7 +595,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Sprite: {fileID: 21300000, guid: a2db4e2865b8b7c4f9e8e3d675ea1526, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -553,14 +636,14 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 6603413684822500355}
|
||||
- {fileID: 4181696969714261080}
|
||||
- {fileID: 3540761466598488858}
|
||||
m_Father: {fileID: 505709450491090271}
|
||||
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: 200, y: 600}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -50, y: -50}
|
||||
m_SizeDelta: {x: 188, y: 738}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2067139795496260713
|
||||
CanvasRenderer:
|
||||
@@ -590,7 +673,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 30b6f81a2fbdce940bb49983bdd4aff1, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 87d4451de9d304b4daf8a706a8160010, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -613,6 +696,96 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ShowMaskGraphic: 1
|
||||
--- !u!1 &5282301458255226074
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4181696969714261080}
|
||||
- component: {fileID: 141690736084006677}
|
||||
- component: {fileID: 1471488146852611581}
|
||||
- component: {fileID: 6235669065097642862}
|
||||
m_Layer: 0
|
||||
m_Name: mask
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4181696969714261080
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5282301458255226074}
|
||||
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: 6603413684822500355}
|
||||
m_Father: {fileID: 1069940504772234767}
|
||||
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: 165, y: 709}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &141690736084006677
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5282301458255226074}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1471488146852611581
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5282301458255226074}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.003921569}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -9058286423249527712, guid: 87ebc40ed2f30a640bd47ca3a72dde6c, 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 &6235669065097642862
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5282301458255226074}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ShowMaskGraphic: 1
|
||||
--- !u!1 &6379783019369532990
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -630,7 +803,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &2481977685806833048
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -647,7 +820,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -44.9, y: 257}
|
||||
m_AnchoredPosition: {x: -43, y: 325.6}
|
||||
m_SizeDelta: {x: 40, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &774016358574117457
|
||||
@@ -688,85 +861,6 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &6977364134619701144
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1160540157065071911}
|
||||
- component: {fileID: 395753390090584756}
|
||||
- component: {fileID: 4889476679959207371}
|
||||
m_Layer: 0
|
||||
m_Name: '?'
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1160540157065071911
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6977364134619701144}
|
||||
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: 6919908692958857229}
|
||||
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 &395753390090584756
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6977364134619701144}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &4889476679959207371
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6977364134619701144}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 24
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 0
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: '?'
|
||||
--- !u!1 &9068573092301114994
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -792,17 +886,17 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9068573092301114994}
|
||||
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: []
|
||||
m_Father: {fileID: 1069940504772234767}
|
||||
m_Father: {fileID: 4181696969714261080}
|
||||
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: 180, y: 580}
|
||||
m_SizeDelta: {x: 188, y: 738}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2405641073507250703
|
||||
CanvasRenderer:
|
||||
@@ -832,7 +926,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: bcecb54d88e46bd4892ad95e1d63eb1f, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 5e0d5a484df6f5c47915c3411819dff6, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
|
||||
@@ -7,6 +7,8 @@ using DG.Tweening;
|
||||
public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler,
|
||||
IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
private const string EmptySlotName = "空置";
|
||||
|
||||
[Header("Hero Slots' Prefabs Necessary Info")]
|
||||
public int heroSlot_slotID;
|
||||
public Image heroSlot_colorImage;
|
||||
@@ -14,12 +16,17 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
public Text heroSlot_heroName;
|
||||
public Image heroImage; // display area for poster
|
||||
public Image heroLevelImage;
|
||||
public Image heroLevelImage_shadow;
|
||||
public Button thisHero_detail_displayButton; // ?
|
||||
|
||||
public GameObject thisHero_detial_panelObject;
|
||||
|
||||
[Header("default Sprite")]
|
||||
public Sprite defaultHeroSprite;
|
||||
[Header("default btm image")]
|
||||
public Image defaultBottomImage;
|
||||
[Header("lock hero material")]
|
||||
[SerializeField] private Material lockHeroMaterial;
|
||||
|
||||
public Color[] headerImage_colors = new Color[5]
|
||||
{
|
||||
@@ -30,6 +37,8 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
Color.white
|
||||
};
|
||||
|
||||
public Sprite[] slotDefaultImage;
|
||||
|
||||
[Header("Skills Container")]
|
||||
public GameObject skillContainer; // Container with Vertical Layout Group for displaying equipped skills
|
||||
|
||||
@@ -44,6 +53,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
private Canvas rootCanvas;
|
||||
private CanvasGroup canvasGroup;
|
||||
private LayoutElement layoutElement;
|
||||
private int lastObservedHeroId = int.MinValue;
|
||||
|
||||
[Header("Hover Anim")]
|
||||
[SerializeField] bool enableHoverAnim = true;
|
||||
@@ -67,11 +77,187 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
static readonly Dictionary<Transform, List<LayoutInfo>> layoutCache = new();
|
||||
static readonly Dictionary<Transform, bool> layoutAxisIsHorizontal = new();
|
||||
|
||||
private void SetHeroImageAlpha(float alpha)
|
||||
{
|
||||
if (heroImage == null) return;
|
||||
if (!heroImage.gameObject.activeSelf)
|
||||
{
|
||||
heroImage.gameObject.SetActive(true);
|
||||
}
|
||||
Color c = heroImage.color;
|
||||
c.a = Mathf.Clamp01(alpha);
|
||||
heroImage.color = c;
|
||||
}
|
||||
|
||||
private void ApplyEmptyHeroImageState(Sprite fallbackSprite = null)
|
||||
{
|
||||
if (heroImage == null) return;
|
||||
|
||||
if (fallbackSprite != null)
|
||||
{
|
||||
heroImage.sprite = fallbackSprite;
|
||||
}
|
||||
else if (defaultHeroSprite != null)
|
||||
{
|
||||
heroImage.sprite = defaultHeroSprite;
|
||||
}
|
||||
|
||||
SetHeroImageAlpha(0f);
|
||||
}
|
||||
|
||||
private void ApplyDefaultBottomImageBySlot()
|
||||
{
|
||||
if (defaultBottomImage == null || slotDefaultImage == null) return;
|
||||
if (heroSlot_slotID < 0 || heroSlot_slotID >= slotDefaultImage.Length) return;
|
||||
|
||||
Sprite slotSprite = slotDefaultImage[heroSlot_slotID];
|
||||
if (slotSprite != null)
|
||||
{
|
||||
defaultBottomImage.sprite = slotSprite;
|
||||
}
|
||||
}
|
||||
|
||||
private void SyncHeroLevelImageShadow()
|
||||
{
|
||||
if (heroLevelImage_shadow == null || heroLevelImage == null) return;
|
||||
heroLevelImage_shadow.sprite = heroLevelImage.sprite;
|
||||
}
|
||||
|
||||
private void SetImageAlpha(Image image, float alpha)
|
||||
{
|
||||
if (image == null) return;
|
||||
Color c = image.color;
|
||||
c.a = Mathf.Clamp01(alpha);
|
||||
image.color = c;
|
||||
}
|
||||
|
||||
private void SetHeroLevelImagesVisible(bool visible)
|
||||
{
|
||||
float alpha = visible ? 1f : 0f;
|
||||
SetImageAlpha(heroLevelImage, alpha);
|
||||
SetImageAlpha(heroLevelImage_shadow, alpha);
|
||||
}
|
||||
|
||||
private string ResolveHeroDisplayName(int heroId, string fallbackName = null)
|
||||
{
|
||||
if (heroId == 0)
|
||||
{
|
||||
return EmptySlotName;
|
||||
}
|
||||
|
||||
AllyHero_SO hero = FindHeroById(heroId);
|
||||
if (hero != null && !string.IsNullOrEmpty(hero.ally_heroName))
|
||||
{
|
||||
return hero.ally_heroName;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(fallbackName) && fallbackName != EmptySlotName)
|
||||
{
|
||||
return fallbackName;
|
||||
}
|
||||
|
||||
return EmptySlotName;
|
||||
}
|
||||
|
||||
private void RefreshHeroNameFromCurrentId(string fallbackName = null)
|
||||
{
|
||||
if (heroSlot_heroName == null) return;
|
||||
if (heroSlot_heroID <= 0)
|
||||
{
|
||||
heroSlot_heroName.text = EmptySlotName;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(fallbackName) && fallbackName != EmptySlotName)
|
||||
{
|
||||
heroSlot_heroName.text = fallbackName;
|
||||
return;
|
||||
}
|
||||
|
||||
AllyHero_SO hero = FindHeroById(heroSlot_heroID);
|
||||
if (hero != null && !string.IsNullOrWhiteSpace(hero.ally_heroName))
|
||||
{
|
||||
heroSlot_heroName.text = hero.ally_heroName;
|
||||
return;
|
||||
}
|
||||
|
||||
heroSlot_heroName.text = EmptySlotName;
|
||||
}
|
||||
|
||||
public void RefreshSlotVisualsFromCurrentHero(bool refreshSkills = true)
|
||||
{
|
||||
if (heroSlot_heroID <= 0)
|
||||
{
|
||||
RefreshHeroNameFromCurrentId();
|
||||
if (heroImage != null)
|
||||
{
|
||||
ApplyEmptyHeroImageState();
|
||||
}
|
||||
if (heroLevelImage != null)
|
||||
{
|
||||
heroLevelImage.sprite = null;
|
||||
SetHeroLevelImagesVisible(false);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
if (refreshSkills)
|
||||
{
|
||||
UpdateSkillList(false);
|
||||
}
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
return;
|
||||
}
|
||||
|
||||
AllyHero_SO hero = FindHeroById(heroSlot_heroID);
|
||||
if (hero == null)
|
||||
{
|
||||
RefreshHeroNameFromCurrentId();
|
||||
if (refreshSkills)
|
||||
{
|
||||
UpdateSkillList(false);
|
||||
}
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
return;
|
||||
}
|
||||
|
||||
if (heroSlot_heroName != null)
|
||||
{
|
||||
heroSlot_heroName.text = !string.IsNullOrWhiteSpace(hero.ally_heroName) ? hero.ally_heroName : EmptySlotName;
|
||||
}
|
||||
|
||||
if (heroImage != null)
|
||||
{
|
||||
heroImage.sprite = hero.ally_heroPoster;
|
||||
SetHeroImageAlpha(hero.ally_heroPoster != null ? 1f : 0f);
|
||||
}
|
||||
|
||||
if (heroLevelImage != null)
|
||||
{
|
||||
string level = GetRatingFromSO(hero);
|
||||
heroLevelImage.sprite = GetLevelSprite(level);
|
||||
SetHeroLevelImagesVisible(heroLevelImage.sprite != null);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
|
||||
if (refreshSkills)
|
||||
{
|
||||
UpdateSkillList(false);
|
||||
}
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
rootCanvas = GetComponentInParent<Canvas>();
|
||||
layoutElement = GetComponent<LayoutElement>() ?? gameObject.AddComponent<LayoutElement>();
|
||||
if (heroImage != null) heroImage.raycastTarget = true;
|
||||
if (heroImage != null)
|
||||
{
|
||||
heroImage.raycastTarget = true;
|
||||
if (!heroImage.gameObject.activeSelf)
|
||||
{
|
||||
heroImage.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
ApplyDefaultBottomImageBySlot();
|
||||
// Ensure header colors have visible alpha on start
|
||||
if (headerImage_colors != null)
|
||||
{
|
||||
@@ -103,17 +289,24 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
}
|
||||
}
|
||||
|
||||
// ensure hero image transparent if not set
|
||||
if (heroImage != null && heroImage.sprite == null)
|
||||
// Empty slots keep their configured sprite but remain visually hidden until a hero is assigned.
|
||||
if (heroSlot_heroID == 0)
|
||||
{
|
||||
heroImage.color = new Color(heroImage.color.r, heroImage.color.g, heroImage.color.b, 0f);
|
||||
ApplyEmptyHeroImageState();
|
||||
}
|
||||
else if (heroImage != null && heroImage.sprite == null)
|
||||
{
|
||||
SetHeroImageAlpha(0f);
|
||||
}
|
||||
|
||||
// ensure hero level image transparent if not set
|
||||
if (heroLevelImage != null && heroLevelImage.sprite == null)
|
||||
{
|
||||
heroLevelImage.color = new Color(heroLevelImage.color.r, heroLevelImage.color.g, heroLevelImage.color.b, 0f);
|
||||
SetHeroLevelImagesVisible(false);
|
||||
}
|
||||
SyncHeroLevelImageShadow();
|
||||
RefreshHeroNameFromCurrentId();
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
|
||||
// Add listener for detail display button
|
||||
if (thisHero_detail_displayButton != null)
|
||||
@@ -122,6 +315,27 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
RefreshHeroNameFromCurrentId();
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
bool heroIdChanged = lastObservedHeroId != heroSlot_heroID;
|
||||
bool nameLooksWrong = heroSlot_heroName != null
|
||||
&& heroSlot_heroID > 0
|
||||
&& (string.IsNullOrWhiteSpace(heroSlot_heroName.text) || heroSlot_heroName.text == EmptySlotName);
|
||||
|
||||
if (!heroIdChanged && !nameLooksWrong)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshSlotVisualsFromCurrentHero(false);
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
// Editor-time guard: ensure header colors alpha not zero
|
||||
@@ -197,23 +411,32 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
sourceId = sourceRole.roleCard_heroID;
|
||||
}
|
||||
|
||||
AllyHero_SO sourceHero = FindHeroById(sourceId);
|
||||
if (sourceId > 0 && (sourceHero == null || !sourceHero.isUnlocked))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Update slot info with character id
|
||||
heroSlot_heroID = sourceId;
|
||||
|
||||
// Try to find AllyHero_SO by id and set poster/profile/name
|
||||
AllyHero_SO found = null;
|
||||
AllyHero_SO found = sourceHero;
|
||||
try
|
||||
{
|
||||
if (_cachedAllyHeroSOs == null || _cachedAllyHeroSOs.Length == 0)
|
||||
if (found == null)
|
||||
{
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("");
|
||||
}
|
||||
foreach (var a in _cachedAllyHeroSOs)
|
||||
{
|
||||
if (a != null && a.ally_heroID == heroSlot_heroID)
|
||||
if (_cachedAllyHeroSOs == null || _cachedAllyHeroSOs.Length == 0)
|
||||
{
|
||||
found = a;
|
||||
break;
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("");
|
||||
}
|
||||
foreach (var a in _cachedAllyHeroSOs)
|
||||
{
|
||||
if (a != null && a.ally_heroID == heroSlot_heroID)
|
||||
{
|
||||
found = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,7 +444,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
|
||||
if (found != null)
|
||||
{
|
||||
if (heroSlot_heroName != null) heroSlot_heroName.text = found.ally_heroName;
|
||||
if (heroSlot_heroName != null) heroSlot_heroName.text = !string.IsNullOrWhiteSpace(found.ally_heroName) ? found.ally_heroName : EmptySlotName;
|
||||
// show poster on the hero slot image
|
||||
if (heroImage != null && found.ally_heroPoster != null)
|
||||
{
|
||||
@@ -247,12 +470,14 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
{
|
||||
string level = GetRatingFromSO(found);
|
||||
heroLevelImage.sprite = GetLevelSprite(level);
|
||||
heroLevelImage.color = heroLevelImage.sprite != null ? Color.white : new Color(1f, 1f, 1f, 0f);
|
||||
SetHeroLevelImagesVisible(heroLevelImage.sprite != null);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
else if (heroLevelImage != null)
|
||||
{
|
||||
heroLevelImage.sprite = null;
|
||||
heroLevelImage.color = new Color(1f, 1f, 1f, 0f);
|
||||
SetHeroLevelImagesVisible(false);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -261,9 +486,9 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
if (heroSlot_heroName != null)
|
||||
{
|
||||
if (sourceCard != null && sourceCard.characterImage != null)
|
||||
heroSlot_heroName.text = sourceCard.characterImage.gameObject.name;
|
||||
heroSlot_heroName.text = !string.IsNullOrWhiteSpace(sourceCard.characterImage.gameObject.name) ? sourceCard.characterImage.gameObject.name : EmptySlotName;
|
||||
else if (sourceRole != null && sourceRole.roleCard_heroProfile != null)
|
||||
heroSlot_heroName.text = sourceRole.roleCard_heroProfile.gameObject.name;
|
||||
heroSlot_heroName.text = !string.IsNullOrWhiteSpace(sourceRole.roleCard_heroProfile.gameObject.name) ? sourceRole.roleCard_heroProfile.gameObject.name : EmptySlotName;
|
||||
}
|
||||
if (heroImage != null)
|
||||
{
|
||||
@@ -323,25 +548,16 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
{
|
||||
int prevId = heroSlot_heroID; // remember previous id
|
||||
heroSlot_heroID = 0;
|
||||
if (heroSlot_heroName != null) heroSlot_heroName.text = "绌虹疆";
|
||||
if (heroSlot_heroName != null) heroSlot_heroName.text = EmptySlotName;
|
||||
if (heroImage != null)
|
||||
{
|
||||
// revert to default sprite if provided, otherwise keep transparent
|
||||
if (defaultHeroSprite != null)
|
||||
{
|
||||
heroImage.sprite = defaultHeroSprite;
|
||||
heroImage.color = new Color(heroImage.color.r, heroImage.color.g, heroImage.color.b, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
heroImage.sprite = null;
|
||||
heroImage.color = new Color(heroImage.color.r, heroImage.color.g, heroImage.color.b, 0f);
|
||||
}
|
||||
ApplyEmptyHeroImageState();
|
||||
}
|
||||
if (heroLevelImage != null)
|
||||
{
|
||||
heroLevelImage.sprite = null;
|
||||
heroLevelImage.color = new Color(1f, 1f, 1f, 0f);
|
||||
SetHeroLevelImagesVisible(false);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
if (TeamManager.Instance != null)
|
||||
{
|
||||
@@ -363,6 +579,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
PlaySlotChangeAnim();
|
||||
TeamSelectorAnimController.NotifyTeamChanged();
|
||||
}
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
}
|
||||
|
||||
// Drag between slots only
|
||||
@@ -426,9 +643,33 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
public void SetSlot(int id, string name, Sprite sprite, bool refreshSkills = true)
|
||||
{
|
||||
heroSlot_heroID = id;
|
||||
if (heroSlot_heroName != null) heroSlot_heroName.text = name ?? string.Empty;
|
||||
if (heroImage != null) heroImage.sprite = sprite;
|
||||
if (heroImage != null) heroImage.color = sprite != null ? new Color(heroImage.color.r, heroImage.color.g, heroImage.color.b, 1f) : new Color(heroImage.color.r, heroImage.color.g, heroImage.color.b, 0f);
|
||||
if (heroSlot_heroName != null)
|
||||
{
|
||||
if (heroSlot_heroID <= 0)
|
||||
{
|
||||
heroSlot_heroName.text = EmptySlotName;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(name) && name != EmptySlotName)
|
||||
{
|
||||
heroSlot_heroName.text = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
RefreshHeroNameFromCurrentId();
|
||||
}
|
||||
}
|
||||
if (heroImage != null)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
ApplyEmptyHeroImageState(sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
heroImage.sprite = sprite;
|
||||
SetHeroImageAlpha(sprite != null ? 1f : 0f);
|
||||
}
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
if (id != 0)
|
||||
@@ -441,19 +682,22 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
{
|
||||
string level = GetRatingFromSO(hero);
|
||||
heroLevelImage.sprite = GetLevelSprite(level);
|
||||
heroLevelImage.color = heroLevelImage.sprite != null ? Color.white : new Color(1f, 1f, 1f, 0f);
|
||||
SetHeroLevelImagesVisible(heroLevelImage.sprite != null);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (heroLevelImage != null)
|
||||
{
|
||||
heroLevelImage.sprite = null;
|
||||
heroLevelImage.color = new Color(1f, 1f, 1f, 0f);
|
||||
SetHeroLevelImagesVisible(false);
|
||||
SyncHeroLevelImageShadow();
|
||||
}
|
||||
|
||||
// Update skill list after setting slot
|
||||
if (refreshSkills)
|
||||
UpdateSkillList();
|
||||
lastObservedHeroId = heroSlot_heroID;
|
||||
}
|
||||
|
||||
// Update the skill list in the container
|
||||
@@ -645,6 +889,11 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
EnsureHeroCache();
|
||||
if (_cachedHeroById != null && _cachedHeroById.TryGetValue(id, out var hero))
|
||||
return hero;
|
||||
|
||||
RebuildHeroCache();
|
||||
if (_cachedHeroById != null && _cachedHeroById.TryGetValue(id, out hero))
|
||||
return hero;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -653,6 +902,12 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
if (_cachedHeroById != null && _cachedHeroById.Count > 0)
|
||||
return;
|
||||
|
||||
RebuildHeroCache();
|
||||
}
|
||||
|
||||
private static void RebuildHeroCache()
|
||||
{
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("so/ally");
|
||||
if (_cachedAllyHeroSOs == null || _cachedAllyHeroSOs.Length == 0)
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("");
|
||||
|
||||
@@ -667,6 +922,15 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHeroUnlocked(int heroId)
|
||||
{
|
||||
if (heroId <= 0)
|
||||
return false;
|
||||
|
||||
AllyHero_SO hero = FindHeroById(heroId);
|
||||
return hero != null && hero.isUnlocked;
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
private Sprite GetLevelSprite(string level)
|
||||
{
|
||||
|
||||
@@ -145,6 +145,11 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
|
||||
// Notify loadSkillsSelect to update skill card selections
|
||||
loadSkillsSelect.Instance?.UpdateSkillCardSelections();
|
||||
|
||||
if (newTeamSelector.Instance != null)
|
||||
{
|
||||
newTeamSelector.Instance.RefreshTeamShareCodeDisplay();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// Save the SO changes to disk
|
||||
if (so != null)
|
||||
|
||||
Reference in New Issue
Block a user