1
This commit is contained in:
@@ -304,7 +304,10 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
|
||||
|
||||
UnLoadResources();
|
||||
SceneManager.UnloadSceneAsync(sceneName);
|
||||
// 场景可能未加载或已卸载,做保护避免重复卸载报错
|
||||
var scene = SceneManager.GetSceneByName(sceneName);
|
||||
if (scene.IsValid() && scene.isLoaded)
|
||||
SceneManager.UnloadSceneAsync(sceneName);
|
||||
WebSocketManager.Instance.Close(SocketType.game);
|
||||
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
RefreshUI();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -228,6 +229,7 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
RefreshUI();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -269,6 +271,7 @@ public class UIHome_BY_ShopPanel : SubUIBase
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
RefreshUI();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest.Objs;
|
||||
using Assets.MyGame.Scripts.Net.APIResponses.HomeMain_User;
|
||||
@@ -208,15 +208,25 @@ public class UIHomeMain : UIBase
|
||||
}
|
||||
public void UpdateUserData()
|
||||
{
|
||||
if (GameManager.Instance?.user?.assets == null) return;
|
||||
|
||||
tMP_GoldCoinNum.text = GameManager.Instance.user.assets.gold.ToString();
|
||||
tMP_DiamondNum.text = GameManager.Instance.user.assets.diamond.ToString();
|
||||
|
||||
userName.text = GameManager.Instance.user.BaseInfo.userName;
|
||||
userID.text = GameManager.Instance.user.BaseInfo.number;
|
||||
img_VIP.sprite = sprite_VIP[GameManager.Instance.user.assets.vipLevel];
|
||||
|
||||
// VIP 图标越界保护:vipLevel 超出列表范围时用最后一个,避免异常中断刷新
|
||||
int vipLevel = GameManager.Instance.user.assets.vipLevel;
|
||||
if (sprite_VIP != null && sprite_VIP.Count > 0 && img_VIP != null)
|
||||
{
|
||||
int idx = Mathf.Clamp(vipLevel, 0, sprite_VIP.Count - 1);
|
||||
img_VIP.sprite = sprite_VIP[idx];
|
||||
}
|
||||
|
||||
RefreshAvatar();
|
||||
RefreshAvatarFrame();
|
||||
img_VIP.SetNativeSize();
|
||||
if (img_VIP != null) img_VIP.SetNativeSize();
|
||||
}
|
||||
|
||||
private void RefreshAvatar()
|
||||
|
||||
@@ -20,6 +20,9 @@ public class RegisterPanel : SubUIBase
|
||||
private string _realQueRenPassword = "";
|
||||
private Coroutine _maskCoroutine, _maskCoroutine2;
|
||||
|
||||
/// <summary>当前验证码(不区分大小写比对)</summary>
|
||||
private string _captchaCode = "";
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -37,8 +40,25 @@ public class RegisterPanel : SubUIBase
|
||||
tMPInput_QueRenPassword.contentType = TMP_InputField.ContentType.Standard;
|
||||
tMPInput_QueRenPassword.onValueChanged.AddListener(v => OnPwdChanged(v, tMPInput_QueRenPassword, ref _realQueRenPassword, ref _maskCoroutine2));
|
||||
|
||||
// 点击验证码图片刷新
|
||||
if (img_YZM != null)
|
||||
{
|
||||
var yzmBtn = img_YZM.GetComponent<Button>();
|
||||
if (yzmBtn == null) yzmBtn = img_YZM.gameObject.AddComponent<Button>();
|
||||
yzmBtn.onClick.AddListener(RefreshCaptcha);
|
||||
}
|
||||
|
||||
btn_Register.onClick.AddListener(() =>
|
||||
{
|
||||
// 校验验证码(不区分大小写)
|
||||
if (string.IsNullOrEmpty(_captchaCode) ||
|
||||
!string.Equals(tMPInput_YZM.text, _captchaCode, System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
UIManager.Instance.ShowBoardError("验证码错误");
|
||||
RefreshCaptcha();
|
||||
return;
|
||||
}
|
||||
|
||||
APIRequestList.Register(new Assets.MyGame.Scripts.Net.APIRequest.Objs.RegisterObj
|
||||
{
|
||||
mobile = tMPInput_UserName.text,
|
||||
@@ -53,6 +73,17 @@ public class RegisterPanel : SubUIBase
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
RefreshCaptcha();
|
||||
}
|
||||
|
||||
/// <summary>生成并显示新的验证码图片</summary>
|
||||
private void RefreshCaptcha()
|
||||
{
|
||||
if (img_YZM == null) return;
|
||||
var sprite = CaptchaGenerator.Generate(160, 60, out _captchaCode, 4);
|
||||
img_YZM.sprite = sprite;
|
||||
if (tMPInput_YZM != null) tMPInput_YZM.text = "";
|
||||
}
|
||||
|
||||
private void OnPwdChanged(string display, TMP_InputField input, ref string real, ref Coroutine cr)
|
||||
|
||||
@@ -1,5 +1,95 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &130878127009665589
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 402500192337834392}
|
||||
- component: {fileID: 6648427320965333739}
|
||||
- component: {fileID: 5162676732187391039}
|
||||
- component: {fileID: 1702240637627174844}
|
||||
m_Layer: 0
|
||||
m_Name: "\u9A8C\u8BC1\u7801\u63D0\u793A\u6846 (1)"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &402500192337834392
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 130878127009665589}
|
||||
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: 8238622764576799807}
|
||||
m_Father: {fileID: 5760332990951854565}
|
||||
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: 206.50009, y: -152.50008}
|
||||
m_SizeDelta: {x: 189, y: 62}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6648427320965333739
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 130878127009665589}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5162676732187391039
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 130878127009665589}
|
||||
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: aa1c61138c61f7d4f97e514c84efe1d9, 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 &1702240637627174844
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 130878127009665589}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ShowMaskGraphic: 1
|
||||
--- !u!1 &371857212190886996
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3003,7 +3093,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 0.8, y: 0.8, z: 0.8}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 8238622764576799807}
|
||||
- {fileID: 402500192337834392}
|
||||
- {fileID: 6788651556310521657}
|
||||
- {fileID: 7742629450309001792}
|
||||
- {fileID: 9121190289241508109}
|
||||
@@ -3215,11 +3305,11 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 5760332990951854565}
|
||||
m_Father: {fileID: 402500192337834392}
|
||||
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: 206.50009, y: -152.50006}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 189, y: 62}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8120169878869360682
|
||||
@@ -3250,7 +3340,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: aa1c61138c61f7d4f97e514c84efe1d9, type: 3}
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -3816,6 +3906,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
btn_Close: {fileID: 4276198549132994028}
|
||||
uIEffect: 1
|
||||
tMPInput_UserName: {fileID: 4492449882434305716}
|
||||
tMPInput_Password: {fileID: 4410289030012361464}
|
||||
tMPInput_QueRenPassword: {fileID: 8639823229264985157}
|
||||
|
||||
Reference in New Issue
Block a user