1
This commit is contained in:
@@ -5552,6 +5552,11 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 1096182889}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2189820374461339302, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4683725052380794649, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
@@ -5652,6 +5657,11 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5436103631707523789, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6568873253317409902, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
@@ -5692,6 +5702,16 @@ PrefabInstance:
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7741008535677535188, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8156378713621244176, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8876291267844903025, guid: f206f68250e35c54481406a83c165790,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
|
||||
@@ -8807,7 +8807,7 @@ MonoBehaviour:
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_Interactable: 0
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_FillRect: {fileID: 7472470633991249608}
|
||||
m_HandleRect: {fileID: 0}
|
||||
@@ -16913,7 +16913,7 @@ MonoBehaviour:
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_TargetGraphic: {fileID: 7718981931123179897}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
@@ -16965,7 +16965,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 1527984143713383169}
|
||||
- component: {fileID: 8033538831435769240}
|
||||
- component: {fileID: 5179211485638462881}
|
||||
- component: {fileID: 776685376167304651}
|
||||
m_Layer: 0
|
||||
m_Name: "30\u592910:01:50"
|
||||
m_TagString: Untagged
|
||||
@@ -16989,8 +16989,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: 159.99997, y: 0}
|
||||
m_SizeDelta: {x: 162, y: 26}
|
||||
m_AnchoredPosition: {x: 159.99997, y: 1.6769}
|
||||
m_SizeDelta: {x: 162, y: 29.3538}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8033538831435769240
|
||||
CanvasRenderer:
|
||||
@@ -17000,7 +17000,7 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5319124156298315513}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5179211485638462881
|
||||
--- !u!114 &776685376167304651
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -17009,7 +17009,7 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 5319124156298315513}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
@@ -17020,16 +17020,76 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 77a32e24e847fb943807d07a8cff3f1b, 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
|
||||
m_text: "30\u592910:01:50"
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 5d4a713fdd931db4c9ce49f068b54e0a, type: 2}
|
||||
m_sharedMaterial: {fileID: 3593458263369068374, guid: 5d4a713fdd931db4c9ce49f068b54e0a,
|
||||
type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4279756846
|
||||
m_fontColor: {r: 0.18039216, g: 0.909804, b: 0.09019608, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 28
|
||||
m_fontSizeBase: 28
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 0
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &5358519557799794069
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -19488,7 +19548,19 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 3305275072961299247}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 5263909733976706347}
|
||||
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 1
|
||||
m_CallState: 2
|
||||
--- !u!1 &6011460363266197721
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -22188,6 +22260,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tmp_ExpCount: {fileID: 2871107947423526397}
|
||||
tmp_ExpJinDu: {fileID: 1734379018237689706}
|
||||
tmp_RenWoLabel: {fileID: 352850241436003180}
|
||||
jinDu: {fileID: 935703621404597611}
|
||||
lingQu: {fileID: 7760854768159956749}
|
||||
@@ -24235,6 +24308,7 @@ MonoBehaviour:
|
||||
btn_GetAllGift: {fileID: 5812119166287877420}
|
||||
btn_BuyJinJieZhanLing: {fileID: 7563449252917026989}
|
||||
btn_BuyZhanLing_Label: {fileID: 3554269888248240228}
|
||||
tmp_ActiveTime: {fileID: 776685376167304651}
|
||||
renWuItemPrefab: {fileID: 3780547620844255518}
|
||||
renWuItemParent: {fileID: 4557754362310033953}
|
||||
buyLevelGiftitemPrefab: {fileID: 930733755254247842}
|
||||
@@ -24244,6 +24318,7 @@ MonoBehaviour:
|
||||
slider_BuyLevelExpCount: {fileID: 5636591641690678987}
|
||||
btn_Buy: {fileID: 837267387750453869}
|
||||
tmp_PriceNum: {fileID: 1193562588815078309}
|
||||
tmp_BuyLabel: {fileID: 5895704420953922786}
|
||||
huoDongToggleItemPrefab: {fileID: 3542276533729162296}
|
||||
huoDongToggleItemParent: {fileID: 6568873253317409902}
|
||||
btn_JinJie: {fileID: 5442973199467095328}
|
||||
@@ -29872,7 +29947,7 @@ MonoBehaviour:
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_Interactable: 0
|
||||
m_TargetGraphic: {fileID: 0}
|
||||
m_FillRect: {fileID: 7077596146806315097}
|
||||
m_HandleRect: {fileID: 0}
|
||||
@@ -30082,7 +30157,7 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 6595484543134336306}
|
||||
- m_Target: {fileID: 5263909733976706347}
|
||||
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 6
|
||||
@@ -30902,7 +30977,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Content: {fileID: 4557754362310033953}
|
||||
m_Horizontal: 1
|
||||
m_Horizontal: 0
|
||||
m_Vertical: 1
|
||||
m_MovementType: 1
|
||||
m_Elasticity: 0.1
|
||||
|
||||
@@ -6,13 +6,15 @@ using UnityEngine.UI;
|
||||
|
||||
public class RenWuItem : MonoBehaviour
|
||||
{
|
||||
public TextMeshProUGUI tmp_ExpCount;
|
||||
public TextMeshProUGUI tmp_ExpCount;//<color=green>20</color> /20
|
||||
public TextMeshProUGUI tmp_ExpJinDu;//<color=green>20</color> /20
|
||||
public TextMeshProUGUI tmp_RenWoLabel;
|
||||
public Slider jinDu;
|
||||
public Button lingQu;
|
||||
public Button qianWang;
|
||||
public void Init(int expCount, string renWoLabel,float jinDuValue,UIPanel uIPanel,SubUIManager subUIManager)
|
||||
public void Init(int expCount, int currJinDu,int maxJinDu, string renWoLabel,float jinDuValue,UIPanel uIPanel,SubUIManager subUIManager)
|
||||
{
|
||||
tmp_ExpJinDu.text = $"<color=green>{expCount}</color> /{maxJinDu}";
|
||||
tmp_ExpCount.text = expCount.ToString();
|
||||
tmp_RenWoLabel.text = renWoLabel;
|
||||
jinDu.value = jinDuValue;
|
||||
|
||||
@@ -22,6 +22,7 @@ public class ZhanLing_Panel : SubUIBase
|
||||
public Button btn_GetAllGift;
|
||||
public Button btn_BuyJinJieZhanLing;
|
||||
public TextMeshProUGUI btn_BuyZhanLing_Label;
|
||||
public TextMeshProUGUI tmp_ActiveTime; //战令刷新时间 30天10:01:50
|
||||
|
||||
[Header("任务页面")]
|
||||
public RenWuItem renWuItemPrefab;
|
||||
@@ -35,6 +36,7 @@ public class ZhanLing_Panel : SubUIBase
|
||||
public Slider slider_BuyLevelExpCount;
|
||||
public Button btn_Buy;
|
||||
public TextMeshProUGUI tmp_PriceNum;
|
||||
public TextMeshProUGUI tmp_BuyLabel; //购买<color=yellow> 99999 </color>点经验值升至 <color=green>100 </color>级
|
||||
|
||||
[Header("活动切换项")]
|
||||
public GameObject huoDongToggleItemPrefab;
|
||||
@@ -99,10 +101,37 @@ public class ZhanLing_Panel : SubUIBase
|
||||
? new HashSet<int>(_userData.receivedLevels)
|
||||
: new HashSet<int>();
|
||||
|
||||
// 构建等级礼包列表(1-99级)
|
||||
// 构建等级礼包列表(1-99级显示礼包内容,100级占位)
|
||||
foreach (var lv in _config.levelConfig)
|
||||
{
|
||||
if (lv.level >= _maxLevel) continue;
|
||||
if (lv.level > _maxLevel) continue;
|
||||
|
||||
if (lv.level == _maxLevel)
|
||||
{
|
||||
// 100级占位:创建一个空对象保持布局对齐
|
||||
var placeholder = new GameObject("Placeholder_Lv100", typeof(RectTransform));
|
||||
placeholder.transform.SetParent(levelGiftitemParent, false);
|
||||
var rt = placeholder.GetComponent<RectTransform>();
|
||||
var prefabRt = levelGiftitemPrefab.GetComponent<RectTransform>();
|
||||
if (rt != null && prefabRt != null)
|
||||
{
|
||||
rt.sizeDelta = prefabRt.sizeDelta;
|
||||
rt.anchorMin = prefabRt.anchorMin;
|
||||
rt.anchorMax = prefabRt.anchorMax;
|
||||
rt.pivot = prefabRt.pivot;
|
||||
}
|
||||
// 如果 prefab 有 LayoutElement,也复制
|
||||
var prefabLE = levelGiftitemPrefab.GetComponent<LayoutElement>();
|
||||
if (prefabLE != null)
|
||||
{
|
||||
var le = placeholder.AddComponent<LayoutElement>();
|
||||
le.preferredWidth = prefabLE.preferredWidth;
|
||||
le.preferredHeight = prefabLE.preferredHeight;
|
||||
le.minWidth = prefabLE.minWidth;
|
||||
le.minHeight = prefabLE.minHeight;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
var item = Instantiate(levelGiftitemPrefab, levelGiftitemParent);
|
||||
item.gameObject.SetActive(true);
|
||||
@@ -146,16 +175,16 @@ public class ZhanLing_Panel : SubUIBase
|
||||
Destroy(renWuItemParent.GetChild(i).gameObject);
|
||||
|
||||
// 示例任务(后续对接任务列表 API)
|
||||
CreateTaskItem(10, "每日登录", 1f, UIPanel.None);
|
||||
CreateTaskItem(20, "捕鱼10条", 0.5f, UIPanel.None);
|
||||
CreateTaskItem(30, "充值任意金额", 0f, UIPanel.None);
|
||||
CreateTaskItem(10, 10, 20, "每日登录", 0.5f, UIPanel.None);
|
||||
CreateTaskItem(20, 10, 20, "捕鱼10条", 0.5f, UIPanel.None);
|
||||
CreateTaskItem(30, 0, 30, "充值任意金额", 0f, UIPanel.None);
|
||||
}
|
||||
|
||||
private void CreateTaskItem(int expCount, string label, float progress, UIPanel targetPanel)
|
||||
private void CreateTaskItem(int expCount, int currJinDu, int maxJinDu, string label, float progress, UIPanel targetPanel)
|
||||
{
|
||||
var item = Instantiate(renWuItemPrefab, renWuItemParent);
|
||||
item.gameObject.SetActive(true);
|
||||
item.Init(expCount, label, progress, targetPanel, uIManager);
|
||||
item.Init(expCount, currJinDu, maxJinDu, label, progress, targetPanel, uIManager);
|
||||
}
|
||||
|
||||
// ==================== 购买等级页面 ====================
|
||||
@@ -220,11 +249,25 @@ public class ZhanLing_Panel : SubUIBase
|
||||
if (levelsToBuy <= 0)
|
||||
{
|
||||
tmp_PriceNum.text = "已达成";
|
||||
if (tmp_BuyLabel != null) tmp_BuyLabel.text = "";
|
||||
btn_Buy.interactable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 计算从当前等级到目标等级所需总经验
|
||||
int totalExp = 0;
|
||||
if (_config?.levelConfig != null)
|
||||
{
|
||||
for (int lv = _userData.level + 1; lv <= _selectedBuyLevel; lv++)
|
||||
{
|
||||
var cfg = _config.levelConfig.Find(c => c.level == lv);
|
||||
if (cfg != null) totalExp += cfg.exp;
|
||||
}
|
||||
}
|
||||
|
||||
tmp_PriceNum.text = $"{levelsToBuy * 100}钻石";
|
||||
if (tmp_BuyLabel != null)
|
||||
tmp_BuyLabel.text = $"购买<color=yellow> {totalExp} </color>点经验值升至 <color=green>{_selectedBuyLevel} </color>级";
|
||||
btn_Buy.interactable = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user