This commit is contained in:
2026-06-25 16:18:07 +08:00
parent b04a70aeed
commit 51fdabc2e6
11 changed files with 411 additions and 40 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ namespace Assets.MyGame.Scripts.Net
public static Dictionary<APIType, string> dic_API = new Dictionary<APIType, string>();
//public const string baseURL = "http://game5241.wzaxr.top";
#if UNITY_EDITOR
//public const string baseURL = "http://8.137.163.153";
public const string baseURL = "http://8.137.8.46";
public const string baseURL = "http://8.137.163.153";
//public const string baseURL = "http://8.137.8.46";
#else
public const string baseURL = "http://8.137.8.46";
@@ -6,7 +6,7 @@ namespace Assets.MyGame.Scripts.Net.APIRequest.Params
/// 通用分页查询参数(排行榜/用户列表共用)
/// </summary>
[Serializable]
public class BaseListPageParam : RequestParamBase
public class BaseListPageObj : RequestObjBase
{
public string keyWord;
public int pageIndex;
@@ -102,7 +102,7 @@ namespace Assets.MyGame.Scripts.Net
/// <summary>
/// 获取排行榜(用户列表分页)(POST)
/// </summary>
public static void GetRankList(BaseListPageParam req, Action<List<UserListItemDto>> callback)
public static void GetRankList(BaseListPageObj req, Action<List<UserListItemDto>> callback)
{
APIManager.Response<List<UserListItemDto>>(APIType.Rank_GetUserList, req, callback);
}
@@ -25,8 +25,8 @@ namespace Assets.MyGame.Scripts.Net
//private const string baseUrl = "ws://game5241.wzaxr.top";
#if UNITY_EDITOR
//private const string baseUrl = "ws://8.137.163.153";
private const string baseUrl = "ws://8.137.8.46";
private const string baseUrl = "ws://8.137.163.153";
//private const string baseUrl = "ws://8.137.8.46";
#else
private const string baseUrl = "ws://8.137.8.46";
+296 -23
View File
@@ -29,13 +29,15 @@ 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: 5493264903810928390}
- {fileID: 3879196099675902296}
m_Father: {fileID: 1365097840134096483}
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: 197.49997, y: 266.5}
m_SizeDelta: {x: 67, y: 43}
m_AnchoredPosition: {x: 225.66211, y: 266.5}
m_SizeDelta: {x: 228.911, y: 43}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5406972213120452484
CanvasRenderer:
@@ -66,7 +68,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 8a095ebb93c64e24bad8eab9877cd6af, type: 3}
m_Type: 0
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
@@ -565,7 +567,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &5471977930610842927
RectTransform:
m_ObjectHideFlags: 0
@@ -652,13 +654,15 @@ 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: 1022854519716181371}
- {fileID: 2640621591493656043}
m_Father: {fileID: 1365097840134096483}
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: 31.499989, y: 266.5}
m_SizeDelta: {x: 67, y: 43}
m_AnchoredPosition: {x: -42.63733, y: 266.5}
m_SizeDelta: {x: 223.6811, y: 43}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8275991562925281708
CanvasRenderer:
@@ -688,8 +692,8 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 2a3fe56c72362b04c8332c55a113c12e, type: 3}
m_Type: 0
m_Sprite: {fileID: 21300000, guid: 8a095ebb93c64e24bad8eab9877cd6af, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
@@ -870,7 +874,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &40531820019269675
RectTransform:
m_ObjectHideFlags: 0
@@ -958,8 +962,6 @@ RectTransform:
m_Children:
- {fileID: 3125779355109396306}
- {fileID: 4569178911461540903}
- {fileID: 1022854519716181371}
- {fileID: 5493264903810928390}
m_Father: {fileID: 2452721543265757133}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -1611,7 +1613,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &7165262833516321450
RectTransform:
m_ObjectHideFlags: 0
@@ -1838,6 +1840,7 @@ MonoBehaviour:
tMP_Description: {fileID: 5258184139177171062}
img_Prop: {fileID: 4306247461914798709}
propID:
propType: 0
scrollRect: {fileID: 913925080212605732}
btn_Use: {fileID: 4535463459306943413}
--- !u!222 &-6269927553038755508
@@ -2476,7 +2479,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &5768290550798851746
RectTransform:
m_ObjectHideFlags: 0
@@ -2623,6 +2626,141 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_AllowSwitchOff: 0
--- !u!1 &8090484746962513107
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2640621591493656043}
- component: {fileID: 203434644837795334}
- component: {fileID: 4810213095655110917}
m_Layer: 0
m_Name: Text (TMP) (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2640621591493656043
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8090484746962513107}
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: 3125779355109396306}
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: 14.636, y: 2.7115}
m_SizeDelta: {x: 194.41, y: 48.4231}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &203434644837795334
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8090484746962513107}
m_CullTransparentMesh: 1
--- !u!114 &4810213095655110917
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8090484746962513107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: 123456789
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: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, 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: 36
m_fontSizeBase: 36
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 &8468123660644546377
GameObject:
m_ObjectHideFlags: 0
@@ -2653,11 +2791,11 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1365097840134096483}
m_Father: {fileID: 3125779355109396306}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 2.4999924, y: 266.5}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 5, y: 0}
m_SizeDelta: {x: 39, y: 39}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7191961574170017789
@@ -2698,6 +2836,141 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &8478276886487584202
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3879196099675902296}
- component: {fileID: 992572010060271508}
- component: {fileID: 7029040538160496600}
m_Layer: 0
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3879196099675902296
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8478276886487584202}
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: 4569178911461540903}
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: 17.251, y: 2.7115}
m_SizeDelta: {x: 194.41, y: 48.4231}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &992572010060271508
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8478276886487584202}
m_CullTransparentMesh: 1
--- !u!114 &7029040538160496600
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8478276886487584202}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: 123456789
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: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, 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: 36
m_fontSizeBase: 36
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 &8679419027771777850
GameObject:
m_ObjectHideFlags: 0
@@ -2728,11 +3001,11 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1365097840134096483}
m_Father: {fileID: 4569178911461540903}
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: 174.99997, y: 265.5}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 11.4999695, y: -1}
m_SizeDelta: {x: 46, y: 41}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3691077083610407395
@@ -11,7 +11,18 @@ using UnityEngine.UI;
[Serializable]
public enum PropEnum
{
none=0
none=0,
炮台 = 1,
翅膀 = 2,
炮塔碎片 = 3,
翅膀碎片 = 4,
战神 = 5,
战神碎片 = 6,
刮刮卡 = 7,
改名卡 = 8,
大喇叭 = 9,
技能 = 10,
召唤卡 = 11,
}
public class BackPackPropItem : MonoBehaviour
{
@@ -24,8 +35,30 @@ public class BackPackPropItem : MonoBehaviour
switch (propEnum)
{
case PropEnum.none:
break;
default:
break;
}
switch (propEnum)
{
case PropEnum.none:
break;
case PropEnum.炮塔碎片:
case PropEnum.翅膀碎片:
item_Bg[1].gameObject.SetActive(true);
break;
case PropEnum.战神碎片:
item_Bg[0].gameObject.SetActive(true);
break;
case PropEnum.刮刮卡:
case PropEnum.召唤卡:
case PropEnum.技能:
item_Bg[2].gameObject.SetActive(true);
break;
case PropEnum.改名卡:
case PropEnum.大喇叭:
item_Bg[3].gameObject.SetActive(true);
break;
default:
break;
}
@@ -178,14 +178,14 @@ RectTransform:
m_GameObject: {fileID: 627277110686942805}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.84583336, y: 0.84583336, z: 0.84583336}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5530117091569492482}
m_Father: {fileID: 7443429307053400732}
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: 543.448, y: 285.17307}
m_AnchoredPosition: {x: 642.5, y: 337.50015}
m_SizeDelta: {x: 64, y: 64}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &96259119428132217
@@ -2769,7 +2769,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 4
m_text: 1023
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 5d4a713fdd931db4c9ce49f068b54e0a, type: 2}
m_sharedMaterial: {fileID: 3593458263369068374, guid: 5d4a713fdd931db4c9ce49f068b54e0a,
@@ -2813,7 +2813,7 @@ MonoBehaviour:
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_enableWordWrapping: 0
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
@@ -2873,6 +2873,7 @@ RectTransform:
- {fileID: 5207806907184652212}
- {fileID: 8096412430408969747}
- {fileID: 2819193408425432736}
- {fileID: 1051696264439407244}
m_Father: {fileID: 5530117091569492482}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -3102,7 +3103,6 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7443429307053400732}
- {fileID: 1051696264439407244}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -3164,4 +3164,4 @@ MonoBehaviour:
uIEffect: 1
obj_LinePrefab: {fileID: 6386860272759417549}
currobj_Line: {fileID: 119203538957789953}
prefabRankLineItem_parent: {fileID: 0}
prefabRankLineItem_parent: {fileID: 6676761536640183889}
@@ -8,6 +8,7 @@ using Unity.VisualScripting;
using UnityEditor.SearchService;
using UnityEngine;
using UnityEngine.UI;
using static UnityEditor.MaterialProperty;
public class UIHome_BY_BackPackPanel : SubUIBase
{
@@ -17,11 +18,15 @@ public class UIHome_BY_BackPackPanel : SubUIBase
public Transform pageParent;
public BackPackPropItem prefabItem;
public TextMeshProUGUI tMP_Gold;
public TextMeshProUGUI tMP_Diamond;
[Header("道具详情")]
public TextMeshProUGUI tMP_Name;
public TextMeshProUGUI tMP_Description;
public Image img_Prop;
public string propID; //这里是道具的ID 之后用来触发使用事件
public PropEnum propType; //这里是道具的类型 之后用来触发使用事件
public ScrollRect scrollRect;
public Button btn_Use;
@@ -61,7 +66,37 @@ public class UIHome_BY_BackPackPanel : SubUIBase
img_Prop.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.one * 0.5f);
});
isfirst = false;
btn_Use.onClick.RemoveAllListeners();
btn_Use.onClick.AddListener(() =>
{
switch (propType)
{
case PropEnum.none:
break;
case PropEnum.炮塔碎片:
break;
case PropEnum.翅膀碎片:
break;
case PropEnum.战神碎片:
break;
case PropEnum.刮刮卡:
uIManager.ShowAsync(UIPanel.GuaGuaKa);
break;
case PropEnum.改名卡:
break;
case PropEnum.大喇叭:
break;
case PropEnum.技能:
break;
case PropEnum.召唤卡:
break;
default:
break;
}
});
}
GameObject obj = Instantiate(prefabItem.gameObject, pageParent);
var tempItem = obj.GetComponent<BackPackPropItem>();
@@ -75,11 +110,41 @@ public class UIHome_BY_BackPackPanel : SubUIBase
tMP_Name.text=product.name;
tMP_Description.text = product.desc;
propID = product.number;
propType=(PropEnum)product.type;
WebTool.DownImage(APIManager.baseURL + product.imageUrl, (texture) =>
{
img_Prop.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.one * 0.5f);
});
btn_Use.onClick.RemoveAllListeners();
btn_Use.onClick.AddListener(() =>
{
switch (propType)
{
case PropEnum.none:
break;
case PropEnum.炮塔碎片:
break;
case PropEnum.翅膀碎片:
break;
case PropEnum.战神碎片:
break;
case PropEnum.刮刮卡:
uIManager.ShowAsync(UIPanel.GuaGuaKa);
break;
case PropEnum.改名卡:
break;
case PropEnum.大喇叭:
break;
case PropEnum.技能:
break;
case PropEnum.召唤卡:
break;
default:
break;
}
});
}
});
@@ -20,7 +20,7 @@ public class UIHome_BY_RankPanel : SubUIBase
private void LoadRankData()
{
APIRequestList.GetRankList(new BaseListPageParam
APIRequestList.GetRankList(new BaseListPageObj
{
keyWord = "",
pageIndex = 0,
@@ -49,7 +49,7 @@ TextureImporter:
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteBorder: {x: 21, y: 18, z: 22, w: 20}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
@@ -113,7 +113,7 @@ TextureImporter:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
internalID: 1537655665
vertices: []
indices:
edges: []