UI update 02
This commit is contained in:
@@ -443,7 +443,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
|
||||
m_Sprite: {fileID: 6144769045846348053, guid: 8dfad0d75bf3c334aa4c0caf1aff7a29, type: 3}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
|
||||
@@ -192,32 +192,6 @@ public class levelBar_controller : MonoBehaviour
|
||||
// Documentation text normalized.
|
||||
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";
|
||||
return so != null ? so.GetDisplayLevelRatingKey() : "C";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
[Tooltip("Horizontal spacing between cursor and details popup.")]
|
||||
public float cursorHorizontalGap = 24f;
|
||||
|
||||
[Tooltip("Extra horizontal spacing used when the popup is displayed to the left of the cursor, such as skill details.")]
|
||||
public float leftCursorHorizontalGap = 96f;
|
||||
|
||||
[Header("Enter Animation")]
|
||||
public bool playEnterAnimation = true;
|
||||
[Min(0.01f)] public float enterAnimDuration = 0.2f;
|
||||
@@ -243,7 +246,8 @@ public class loadDetailsPrefab : MonoBehaviour
|
||||
|
||||
float scaleFactor = Mathf.Max(canvas.scaleFactor, 0.0001f);
|
||||
float prefabWidthPixels = rt.rect.width * scaleFactor;
|
||||
float horizontalOffset = prefabWidthPixels * 0.5f + Mathf.Max(0f, cursorHorizontalGap);
|
||||
float configuredGap = preferLeftOfCursor ? leftCursorHorizontalGap : cursorHorizontalGap;
|
||||
float horizontalOffset = prefabWidthPixels * 0.5f + Mathf.Max(0f, configuredGap);
|
||||
float direction = preferLeftOfCursor ? -1f : 1f;
|
||||
|
||||
Vector2 screenPos = new Vector2(position.x + direction * horizontalOffset, position.y);
|
||||
|
||||
@@ -21,13 +21,10 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
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 bool skillGroupExpandChildHeight = false;
|
||||
public float skillGroupForcedChildHeight = 120f;
|
||||
public int skillGroupPaddingLeft = 0;
|
||||
public int skillGroupPaddingRight = 0;
|
||||
public int skillGroupPaddingTop = 0;
|
||||
@@ -118,7 +115,7 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
{
|
||||
if (_cachedAllyHeroSOs == null || _cachedAllyHeroSOs.Length == 0)
|
||||
{
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("");
|
||||
_cachedAllyHeroSOs = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
}
|
||||
foreach (var a in _cachedAllyHeroSOs)
|
||||
{
|
||||
@@ -212,8 +209,12 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
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);
|
||||
skillGroupRect.anchorMin = new Vector2(0f, 1f);
|
||||
skillGroupRect.anchorMax = new Vector2(1f, 1f);
|
||||
skillGroupRect.pivot = new Vector2(0.5f, 1f);
|
||||
skillGroupRect.offsetMin = new Vector2(0f, skillGroupRect.offsetMin.y);
|
||||
skillGroupRect.offsetMax = new Vector2(0f, skillGroupRect.offsetMax.y);
|
||||
skillGroupRect.anchoredPosition = new Vector2(0f, skillGroupRect.anchoredPosition.y - columnVerticalSpacing);
|
||||
}
|
||||
ConfigureSkillGroupContainer(skillGroupContainer);
|
||||
|
||||
@@ -290,15 +291,19 @@ public class loadSkillsSelect : MonoBehaviour
|
||||
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 existingGrid = skillGroupContainer.GetComponent<GridLayoutGroup>();
|
||||
if (existingGrid != null)
|
||||
{
|
||||
existingGrid.enabled = false;
|
||||
}
|
||||
|
||||
var flow = skillGroupContainer.GetComponent<FlowLayoutGroup>() ?? skillGroupContainer.AddComponent<FlowLayoutGroup>();
|
||||
flow.childAlignment = skillGroupChildAlignment;
|
||||
flow.padding = new RectOffset(skillGroupPaddingLeft, skillGroupPaddingRight, skillGroupPaddingTop, skillGroupPaddingBottom);
|
||||
flow.SpacingX = skillGroupSpacing.x;
|
||||
flow.SpacingY = skillGroupSpacing.y;
|
||||
flow.ExpandChildHeight = skillGroupExpandChildHeight;
|
||||
flow.ForcedChildHeight = skillGroupForcedChildHeight;
|
||||
|
||||
var fitter = skillGroupContainer.GetComponent<ContentSizeFitter>() ?? skillGroupContainer.AddComponent<ContentSizeFitter>();
|
||||
fitter.horizontalFit = skillGroupHorizontalFit;
|
||||
|
||||
@@ -38,10 +38,27 @@ public class loadTeam_select : MonoBehaviour
|
||||
for (int i = contentParent.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
var c = contentParent.GetChild(i);
|
||||
if (c == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Remove the old entry from layout participation immediately so the
|
||||
// newly instantiated first card does not get pushed down for one frame.
|
||||
LayoutElement layoutElement = c.GetComponent<LayoutElement>();
|
||||
if (layoutElement == null)
|
||||
{
|
||||
layoutElement = c.gameObject.AddComponent<LayoutElement>();
|
||||
}
|
||||
layoutElement.ignoreLayout = true;
|
||||
c.gameObject.SetActive(false);
|
||||
|
||||
if (Application.isPlaying) Destroy(c.gameObject);
|
||||
else DestroyImmediate(c.gameObject);
|
||||
}
|
||||
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(contentParent);
|
||||
|
||||
List<AllyHero_SO> found = new List<AllyHero_SO>();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
+5
-5
@@ -57,7 +57,7 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
|
||||
AllyHero_SO found = null;
|
||||
try
|
||||
{
|
||||
var arr = Resources.LoadAll<AllyHero_SO>("");
|
||||
var arr = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
foreach (var a in arr)
|
||||
{
|
||||
if (a != null && a.ally_heroID == heroId) { found = a; break; }
|
||||
@@ -150,11 +150,11 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
|
||||
}
|
||||
if (detail.skill_info_name != null)
|
||||
{
|
||||
detail.skill_info_name.text = "技能槽位空闲";
|
||||
detail.skill_info_name.text = "���ܲ�λ����";
|
||||
}
|
||||
if (detail.skill_info_description != null)
|
||||
{
|
||||
detail.skill_info_description.text = "技能槽位空闲,推荐装配一个技能";
|
||||
detail.skill_info_description.text = "���ܲ�λ���У��Ƽ�װ��һ������";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -167,11 +167,11 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
|
||||
}
|
||||
if (detail.skill_info_name != null)
|
||||
{
|
||||
detail.skill_info_name.text = "技能槽位锁定";
|
||||
detail.skill_info_name.text = "���ܲ�λ����";
|
||||
}
|
||||
if (detail.skill_info_description != null)
|
||||
{
|
||||
detail.skill_info_description.text = "继续升级以解锁新槽位";
|
||||
detail.skill_info_description.text = "���������Խ����²�λ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-32
@@ -137,7 +137,7 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
private AllyHero_SO FindAllyHeroSOById(int id)
|
||||
{
|
||||
if (id == 0) return null;
|
||||
var arr = Resources.LoadAll<AllyHero_SO>("");
|
||||
var arr = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
foreach (var a in arr)
|
||||
{
|
||||
if (a != null && a.ally_heroID == id) return a;
|
||||
@@ -200,37 +200,7 @@ public class roleCard_prefabController : MonoBehaviour, IDropHandler, IBeginDrag
|
||||
|
||||
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";
|
||||
return so != null ? so.GetDisplayLevelRatingKey() : "C";
|
||||
}
|
||||
|
||||
// ---------------- Drag implementation so roleCard entries can be dragged as source ----------------
|
||||
|
||||
@@ -33,11 +33,11 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 4688030792267625363}
|
||||
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: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -15}
|
||||
m_SizeDelta: {x: 264, y: 30}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!222 &8451071590114106180
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -68,18 +68,18 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: cc180dff846d13a4d88ddaed6f77e5cd, type: 3}
|
||||
m_FontSize: 15
|
||||
m_FontSize: 24
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 4
|
||||
m_MaxSize: 15
|
||||
m_MinSize: 1
|
||||
m_MaxSize: 24
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u6280\u80FD\u540D\u79F0"
|
||||
m_Text: "\u6211\u8981\u98DE\u7684\u66F4\u9AD8\u98DE\u5F97\u66F4\u9AD8\u54E6"
|
||||
--- !u!114 &223412468558196702
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -92,8 +92,83 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 0
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!1 &2893359801435112215
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8965700965458597286}
|
||||
- component: {fileID: 758678244863590500}
|
||||
- component: {fileID: 833450972363051919}
|
||||
m_Layer: 0
|
||||
m_Name: space
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8965700965458597286
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2893359801435112215}
|
||||
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: 5357454291925515226}
|
||||
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: 11, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &758678244863590500
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2893359801435112215}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &833450972363051919
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2893359801435112215}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, 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: 0}
|
||||
m_Type: 1
|
||||
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 &4988234301424525429
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -106,6 +181,8 @@ GameObject:
|
||||
- component: {fileID: 6783521660050107131}
|
||||
- component: {fileID: 6997147501832995791}
|
||||
- component: {fileID: 6227919512305899592}
|
||||
- component: {fileID: 6920661592263544519}
|
||||
- component: {fileID: 9109804753743735904}
|
||||
m_Layer: 0
|
||||
m_Name: bottomImage
|
||||
m_TagString: Untagged
|
||||
@@ -120,19 +197,19 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4988234301424525429}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1027150294156609432}
|
||||
m_Father: {fileID: 6728874159946636146}
|
||||
m_Father: {fileID: 5357454291925515226}
|
||||
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: 15, y: 0}
|
||||
m_SizeDelta: {x: 80, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 41, y: -25}
|
||||
m_SizeDelta: {x: 264, y: 30}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!222 &6783521660050107131
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -161,7 +238,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -215,6 +292,46 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &6920661592263544519
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4988234301424525429}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &9109804753743735904
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4988234301424525429}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!1 &6849663232819926772
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -225,6 +342,8 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 6728874159946636146}
|
||||
- component: {fileID: 1290595309408241639}
|
||||
- component: {fileID: 5752236108829666724}
|
||||
- component: {fileID: 8622799576232110131}
|
||||
m_Layer: 0
|
||||
m_Name: skillItem_prefab
|
||||
m_TagString: Untagged
|
||||
@@ -245,15 +364,14 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 8437657956846986280}
|
||||
- {fileID: 3105447207061763408}
|
||||
- {fileID: 4688030792267625363}
|
||||
- {fileID: 5357454291925515226}
|
||||
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: 120, y: 35}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -60, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 50}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &1290595309408241639
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -267,11 +385,13 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
skillCard_bottomImage: {fileID: 6997147501832995791}
|
||||
selectBorder: {fileID: 8487955413782816082}
|
||||
skillCard_skillName: {fileID: 7151068784241930387}
|
||||
skillCard_skillID: 0
|
||||
skillCard_skillIconImage: {fileID: 1351497606914298708}
|
||||
skillCard_skillDescription:
|
||||
skillCard_button: {fileID: 6227919512305899592}
|
||||
unavailableMaterial: {fileID: 2100000, guid: 7701c15f96b443d408ac83222c9b869a, type: 2}
|
||||
skillColor_available: {r: 1, g: 1, b: 1, a: 1}
|
||||
skillColor_selected: {r: 0.5943396, g: 1, b: 0.5943396, a: 1}
|
||||
skillColor_unavailable: {r: 0.5999999, g: 0.5999999, b: 0.5999999, a: 1}
|
||||
@@ -279,6 +399,167 @@ MonoBehaviour:
|
||||
isSelected: 0
|
||||
heroId: 0
|
||||
isReadOnly: 0
|
||||
--- !u!114 &5752236108829666724
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6849663232819926772}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 0
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &8622799576232110131
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6849663232819926772}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!1 &7178143704987981066
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5357454291925515226}
|
||||
- component: {fileID: 9116786002746497156}
|
||||
- component: {fileID: 1440944591623283298}
|
||||
- component: {fileID: 411602702972492068}
|
||||
- component: {fileID: 8487955413782816082}
|
||||
m_Layer: 0
|
||||
m_Name: hori
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5357454291925515226
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7178143704987981066}
|
||||
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: 8965700965458597286}
|
||||
- {fileID: 3105447207061763408}
|
||||
- {fileID: 4688030792267625363}
|
||||
- {fileID: 5190003224851375157}
|
||||
m_Father: {fileID: 6728874159946636146}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -25}
|
||||
m_SizeDelta: {x: 316, y: 50}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!114 &9116786002746497156
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7178143704987981066}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 3
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &1440944591623283298
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7178143704987981066}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
--- !u!222 &411602702972492068
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7178143704987981066}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8487955413782816082
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7178143704987981066}
|
||||
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: c123f863b7b5604489f0ddc316ae874c, type: 3}
|
||||
m_Type: 1
|
||||
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 &7330218100932204269
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -296,7 +577,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &8437657956846986280
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -384,11 +665,11 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6728874159946636146}
|
||||
m_Father: {fileID: 5357454291925515226}
|
||||
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: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 30, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5651005210691825991
|
||||
@@ -429,3 +710,78 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &9011277605552552092
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5190003224851375157}
|
||||
- component: {fileID: 7353423342126546772}
|
||||
- component: {fileID: 3656222557738011941}
|
||||
m_Layer: 0
|
||||
m_Name: space (1)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5190003224851375157
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9011277605552552092}
|
||||
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: 5357454291925515226}
|
||||
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: 11, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7353423342126546772
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9011277605552552092}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3656222557738011941
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9011277605552552092}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.990566, g: 0.990566, b: 0.990566, 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: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -428,7 +428,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
{
|
||||
if (_cachedAllyHeroSOs == null || _cachedAllyHeroSOs.Length == 0)
|
||||
{
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("");
|
||||
_cachedAllyHeroSOs = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
}
|
||||
foreach (var a in _cachedAllyHeroSOs)
|
||||
{
|
||||
@@ -907,9 +907,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
|
||||
private static void RebuildHeroCache()
|
||||
{
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("so/ally");
|
||||
if (_cachedAllyHeroSOs == null || _cachedAllyHeroSOs.Length == 0)
|
||||
_cachedAllyHeroSOs = Resources.LoadAll<AllyHero_SO>("");
|
||||
_cachedAllyHeroSOs = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
|
||||
_cachedHeroById = new Dictionary<int, AllyHero_SO>();
|
||||
if (_cachedAllyHeroSOs == null) return;
|
||||
@@ -953,33 +951,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
|
||||
// Documentation text normalized.
|
||||
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";
|
||||
return so != null ? so.GetDisplayLevelRatingKey() : "C";
|
||||
}
|
||||
|
||||
// Handle detail button click
|
||||
|
||||
@@ -9,13 +9,23 @@ using Bansonic;
|
||||
|
||||
public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
private enum SkillVisualState
|
||||
{
|
||||
Available,
|
||||
Selected,
|
||||
Unavailable,
|
||||
Locked
|
||||
}
|
||||
|
||||
[Header("Inspector")]
|
||||
public Image skillCard_bottomImage;
|
||||
public Image selectBorder;
|
||||
public Text skillCard_skillName;
|
||||
public int skillCard_skillID;
|
||||
public Image skillCard_skillIconImage;
|
||||
public string skillCard_skillDescription;
|
||||
public Button skillCard_button;
|
||||
public Material unavailableMaterial;
|
||||
|
||||
[Header("Inspector")]
|
||||
[Tooltip("Color when the skill is available")]
|
||||
@@ -46,8 +56,35 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
|
||||
|
||||
public void ApplyState()
|
||||
{
|
||||
if (skillCard_bottomImage == null) return;
|
||||
skillCard_bottomImage.color = isSelected ? skillColor_selected : skillColor_available;
|
||||
SkillVisualState visualState = GetVisualState();
|
||||
|
||||
if (skillCard_bottomImage != null)
|
||||
{
|
||||
switch (visualState)
|
||||
{
|
||||
case SkillVisualState.Locked:
|
||||
skillCard_bottomImage.color = skillColor_locked;
|
||||
break;
|
||||
case SkillVisualState.Unavailable:
|
||||
skillCard_bottomImage.color = skillColor_unavailable;
|
||||
break;
|
||||
default:
|
||||
skillCard_bottomImage.color = skillColor_available;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectBorder != null)
|
||||
{
|
||||
Color borderColor = selectBorder.color;
|
||||
borderColor.a = visualState == SkillVisualState.Selected ? 1f : 0f;
|
||||
selectBorder.color = borderColor;
|
||||
}
|
||||
|
||||
if (skillCard_skillIconImage != null)
|
||||
{
|
||||
skillCard_skillIconImage.material = ShouldUseUnavailableMaterial(visualState) ? unavailableMaterial : null;
|
||||
}
|
||||
}
|
||||
|
||||
private AllyHero_SO GetHeroSO()
|
||||
@@ -58,7 +95,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
|
||||
return loadSkillsSelect.Instance.currentHeroSO;
|
||||
}
|
||||
// Documentation text normalized.
|
||||
var arr = Resources.LoadAll<AllyHero_SO>("");
|
||||
var arr = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
foreach (var a in arr)
|
||||
{
|
||||
if (a != null && a.ally_heroID == heroId) return a;
|
||||
@@ -66,6 +103,43 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
|
||||
return null;
|
||||
}
|
||||
|
||||
private SkillVisualState GetVisualState()
|
||||
{
|
||||
if (isSelected)
|
||||
{
|
||||
return SkillVisualState.Selected;
|
||||
}
|
||||
|
||||
AllyHero_SO so = GetHeroSO();
|
||||
if (so == null)
|
||||
{
|
||||
return SkillVisualState.Available;
|
||||
}
|
||||
|
||||
SkillGroup skillGroup = so.GetSkillGroupByID(skillCard_skillID);
|
||||
var levelInfo = so.GetEffectiveLevelForCurrentEXP();
|
||||
int currentLevel = levelInfo?.levelID ?? 0;
|
||||
int requiredLevel = skillGroup?.thisSkill_levelLimit ?? 1;
|
||||
if (currentLevel < requiredLevel)
|
||||
{
|
||||
return SkillVisualState.Locked;
|
||||
}
|
||||
|
||||
int maxSlots = levelInfo?.skill_slot_limited ?? int.MaxValue;
|
||||
int currentEquipped = so.equippedSkillGroupIDs != null ? so.equippedSkillGroupIDs.Where(id => id != 0).Count() : 0;
|
||||
if (currentEquipped >= maxSlots)
|
||||
{
|
||||
return SkillVisualState.Unavailable;
|
||||
}
|
||||
|
||||
return SkillVisualState.Available;
|
||||
}
|
||||
|
||||
private bool ShouldUseUnavailableMaterial(SkillVisualState visualState)
|
||||
{
|
||||
return visualState == SkillVisualState.Unavailable || visualState == SkillVisualState.Locked;
|
||||
}
|
||||
|
||||
// Documentation text normalized.
|
||||
public void ToggleSelect()
|
||||
{
|
||||
@@ -236,7 +310,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
|
||||
// Documentation text normalized.
|
||||
private AllyHero_SO FindHeroById(int id)
|
||||
{
|
||||
var arr = Resources.LoadAll<AllyHero_SO>("");
|
||||
var arr = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
foreach (var a in arr)
|
||||
{
|
||||
if (a != null && a.ally_heroID == id) return a;
|
||||
|
||||
Reference in New Issue
Block a user