This commit is contained in:
wulongxiao 2024-12-17 22:55:40 +08:00
commit 8c77ba8500
19 changed files with 969 additions and 446 deletions

View File

@ -73,6 +73,37 @@ MonoBehaviour:
m_EditorClassIdentifier:
role: {fileID: 8433650274028726420}
panelPrefab: {fileID: 8782491854383104488, guid: 61ffa7d22a51b1e48a3495af66e30de0, type: 3}
--- !u!1 &6651975224276639987
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5621354293604444993}
m_Layer: 0
m_Name: attackPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5621354293604444993
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6651975224276639987}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.578, y: 1.283, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8433650275485930555}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8433650274046349753
GameObject:
m_ObjectHideFlags: 0
@ -83,6 +114,8 @@ GameObject:
m_Component:
- component: {fileID: 8433650274046349754}
- component: {fileID: 8433650274046349755}
- component: {fileID: 8338947269659314045}
- component: {fileID: 5043731074219064517}
m_Layer: 0
m_Name: Circle
m_TagString: Untagged
@ -146,7 +179,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: cce02f3057f76474eb6bf00c47a4d300, type: 3}
m_Sprite: {fileID: 21300000, guid: 99b3017f757ff494dbf8fe57f8e472a6, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
@ -157,6 +190,40 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!95 &8338947269659314045
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8433650274046349753}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: 1f66433ecf921f84f963555f7715a372, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!114 &5043731074219064517
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8433650274046349753}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7d7d3146a1294f044892ae91ba6c7cd6, type: 3}
m_Name:
m_EditorClassIdentifier:
attack: {fileID: 7276635428522831207}
--- !u!1 &8433650274814453344
GameObject:
m_ObjectHideFlags: 0
@ -208,8 +275,10 @@ MonoBehaviour:
damageTyp: 2
attackCooldown: 1
bulltes: []
animator: {fileID: 0}
animator: {fileID: 8338947269659314045}
fireAni: {fileID: 0}
BulletStartPos: {fileID: 5621354293604444993}
direction: {x: 0, y: 0}
--- !u!58 &1338343970434073545
CircleCollider2D:
m_ObjectHideFlags: 0
@ -261,6 +330,7 @@ Transform:
- {fileID: 8433650274814453345}
- {fileID: 8433650274046349754}
- {fileID: 2248967341581213919}
- {fileID: 5621354293604444993}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -301,73 +371,11 @@ MonoBehaviour:
physicalArmor: 10
magicArmor: 5
Navigation: {fileID: 0}
AnimationTree:
- value:
- {fileID: 21300000, guid: a95e23a2fb1de5b429b428575fc6d229, type: 3}
- {fileID: 21300000, guid: 5cdcb1b1e6a34054e8fc9c1d9c7d8470, type: 3}
- {fileID: 21300000, guid: 0a424673c7507094190a35e2d9624206, type: 3}
- {fileID: 21300000, guid: 751b9c211105d9c458bb91e3044719c9, type: 3}
- {fileID: 21300000, guid: e2d1dfc0f0bc9454195df8ce162a81e7, type: 3}
- {fileID: 21300000, guid: 4c1db2a79971ade4a99a6d8606e3589f, type: 3}
- {fileID: 21300000, guid: 035605503600e1545a80049e49701eeb, type: 3}
- {fileID: 21300000, guid: c77e27193843c3d488cb7dfcf157807f, type: 3}
- {fileID: 21300000, guid: cce02f3057f76474eb6bf00c47a4d300, type: 3}
- {fileID: 21300000, guid: 66a0ff30660ca2c429651bf6becb47e2, type: 3}
- {fileID: 21300000, guid: 2ea657538bcc5864e944682f55f30758, type: 3}
- {fileID: 21300000, guid: 599cbadebab7fba4797e0eb775fbb14f, type: 3}
- {fileID: 21300000, guid: 22ee417742d9a3b48940521754303991, type: 3}
- {fileID: 21300000, guid: 16ea51a52181a0a4da0cdd5b6f46fbf4, type: 3}
- {fileID: 21300000, guid: 5ab5e1d6744b3a049bab76c4173f7d34, type: 3}
- {fileID: 21300000, guid: 91714b1d00c9c0a48bc4f4b9e8ff2671, type: 3}
- {fileID: 21300000, guid: 54436a9641a179a44863a8210c66931b, type: 3}
- {fileID: 21300000, guid: e5936823c8341a743926a1f44b6f27e8, type: 3}
- {fileID: 21300000, guid: e45018fdf0e9c104e9232178ec28a823, type: 3}
- {fileID: 21300000, guid: f1d89c6a341fd1c4495c50dbd625f7d5, type: 3}
- {fileID: 21300000, guid: 9ddfafcc66722944e8cee7f94cbea1a7, type: 3}
- {fileID: 21300000, guid: 4127e5ee8bacf1042b8e914c7604695f, type: 3}
- {fileID: 21300000, guid: 4aa8b8d79d4921f458b6e8e4d571a6a4, type: 3}
- {fileID: 21300000, guid: 44939ecf07feab246a39ac744f87e0ca, type: 3}
- {fileID: 21300000, guid: 505d0c44b035cc641858af1fe0f581a4, type: 3}
- {fileID: 21300000, guid: d12c605b66d01b54696091b44afc569c, type: 3}
- {fileID: 21300000, guid: 2e6e0cc82151a3f4da027045fe867bf5, type: 3}
- {fileID: 21300000, guid: ed71e25701409ea4abf789430523fcfc, type: 3}
- {fileID: 21300000, guid: b01fe6eaa35134642951a6f8ef1502c6, type: 3}
- {fileID: 21300000, guid: aa1a7e1072bffa34d8a3ee0ac207d643, type: 3}
- {fileID: 21300000, guid: bea0316dbb637194d8c796a88560b259, type: 3}
- {fileID: 21300000, guid: ad0106d4b0f767247b4441512b528e89, type: 3}
- {fileID: 21300000, guid: c6bee8e234c0b674882b606427d7303e, type: 3}
- {fileID: 21300000, guid: afb0ade23a84d85429cd715368056a75, type: 3}
- {fileID: 21300000, guid: 0f8d1af9585548f44a68db798998070c, type: 3}
- {fileID: 21300000, guid: e0b1946eeaa84f64889965eab5cfe594, type: 3}
- {fileID: 21300000, guid: 47f28cfc2fffa714b8d866b88d0dc57e, type: 3}
- {fileID: 21300000, guid: 70aae2f10edcd3b46a53b82e2191b77d, type: 3}
CharacterAnimationFrameInterval: 50
- value:
- {fileID: 21300000, guid: f162115c0aebc104cbda3d0863e7d39c, type: 3}
- {fileID: 21300000, guid: 4a1b605ee697f7f4d8399f471b63343d, type: 3}
- {fileID: 21300000, guid: 5c6a51db78dfa254ab45a1ac210279ff, type: 3}
- {fileID: 21300000, guid: 338b50c12d52dee4c94f1a0381a5231f, type: 3}
- {fileID: 21300000, guid: fc92a99e63aded5469e1a2005e6695f5, type: 3}
- {fileID: 21300000, guid: dbb3c5581e62721428ba630f9cf52ebb, type: 3}
- {fileID: 21300000, guid: cafd102863559c3448a56e383de85093, type: 3}
- {fileID: 21300000, guid: 0369e34ae494fff4197a4e05db114d74, type: 3}
- {fileID: 21300000, guid: a24dbc18f1e464643afcf77c67751f6c, type: 3}
- {fileID: 21300000, guid: b8d5680c2e871e94fae70d002b49e113, type: 3}
- {fileID: 21300000, guid: 99b3017f757ff494dbf8fe57f8e472a6, type: 3}
- {fileID: 21300000, guid: 9c353b3324d4f8846b356704b2fdcbb2, type: 3}
- {fileID: 21300000, guid: 7d33a073eb8606f4780d66552bae7aa6, type: 3}
- {fileID: 21300000, guid: 6c32a95165bb5ed4091c4b1acba68c2a, type: 3}
- {fileID: 21300000, guid: f9f1ccdc0d7b25a419a5560e50af165d, type: 3}
- {fileID: 21300000, guid: fc186bdafddba5b468899ede3d0a8dc3, type: 3}
- {fileID: 21300000, guid: df6cb156dec004d4a81311485e0343b9, type: 3}
- {fileID: 21300000, guid: b2d0ee46ba8ff7142938acacc7177b5d, type: 3}
- {fileID: 21300000, guid: fbfe7c2d7fc9c124082498ed423a1ed4, type: 3}
- {fileID: 21300000, guid: b2207077f8f04fb45970902f61a6b1a7, type: 3}
CharacterAnimationFrameInterval: 50
AnimationTree: []
animationHighlight: 0
spriteRenderer: {fileID: 8433650274046349755}
image: {fileID: 0}
isAnimationPlay: 1
isAnimationPlay: 0
mycollider: {fileID: 1338343970434073545}
attackClass: {fileID: 7276635428522831207}
CurrentIndex: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4bd025053f8c66544a9dd149bb2cd13e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Attack
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 94e7f9e70d4bb0444803f9a389539eef
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Circle
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1f66433ecf921f84f963555f7715a372
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Stand
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 227692a4dcb70fa489dec3bea2108e86
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit 2e5e8ae1d1fd0b501719f03ad233b124a7926fd5
Subproject commit c1aef9f6a93dce205fe658923b08d6d21868a785

View File

@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PointBulltContro : MonoBehaviour
{
public Attack attack;
void Start()
{
}
public void ShootBullet()
{
attack.Pointattack();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7d7d3146a1294f044892ae91ba6c7cd6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -3,33 +3,39 @@ using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.UI;
using Unity.VisualScripting;
public class FramePanel : MonoBehaviour
{
public Button button;
public Vector2 OrPos;
public bool IsClick;
public Text chart_title;
public Text stats1award;
public Text stats1Name;
public Text stats2award;
public Text stats2Name;
public Text stats3award;
public Text stats3Name;
public Text stats4award;
public Text stats4Name;
public Text stats5award;
public Text stats5Name;
// Start is called before the first frame update
void Start()
async void Start()
{
button.onClick.AddListener(OnClickBtn);
OrPos=transform.position;
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
chart_title.text = info.Data.ChartTitle;
stats1award.text = info.Data.Charts[0].Reward;
stats1Name.text = info.Data.Charts[0].Name;
stats2award.text = info.Data.Charts[1].Reward;
stats2Name.text = info.Data.Charts[1].Name;
stats3award.text = info.Data.Charts[2].Reward;
stats3Name.text = info.Data.Charts[2].Name;
stats4award.text = info.Data.Charts[3].Reward;
stats4Name.text = info.Data.Charts[3].Name;
stats5award.text = info.Data.Charts[4].Reward;
stats5Name.text = info.Data.Charts[4].Name;
}
void OnClickBtn()
{
if (!IsClick)
{
float moveDistance = Screen.height / 4;
transform.DOMoveY(OrPos.y + moveDistance, 0.5f);
IsClick = true;
}
else
{
transform.DOMoveY(OrPos.y, 0.5f);
IsClick=false;
}
}
}

View File

@ -6,14 +6,47 @@ public class Customer_serviceTanchuang : mount
{
public Button Kfbtn;
public Transform canvas;
public Button LogoutBtn;
// Start is called before the first frame update
void Start()
{
Kfbtn.onClick.AddListener(Display_pop_up_window);
LogoutBtn.onClick.AddListener(LogoutClick);
}
private void LogoutClick()
{
List<BoxType> boxTypes = new List<BoxType>();
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 13, content = "确认注销" });
boxTypes.Add(new BoxType { Name = "submit", textName = " 取消确定 ", prompt = "取消", Type = 2 });
GameObject gameObject = add_pop_up();
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "实名认证");//测试输入框回调处理
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
{
if (type == 0)//取消
{
gameObject.GetComponent<input_box_pop_up_window>().destroy();
}
else if (type == 1)//提交
{
bool issucceffull = await Scene_main_jiekou.instance.Cancellations();
if (issucceffull)
{
Application.Quit();
}
else
{
Debug.Log("注销失败");
}
}
});
}
private void Display_pop_up_window()
private void Display_pop_up_window()//联系客服界面
{

View File

@ -23,6 +23,8 @@ public class AssetsPanel : MonoBehaviour
public Text UserName;
public Text UserID;
public Image UserHead;
public Text PersonaText;
public Text PersonID;
// Start is called before the first frame update
void Start()
{
@ -68,7 +70,9 @@ public class AssetsPanel : MonoBehaviour
Ore.text = Scene_main_jiekou.instance.infoData.water.ToString();
Forging.text = Scene_main_jiekou.instance.infoData.forge.ToString();
UserName.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
PersonaText.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
UserID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
PersonID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
}

View File

@ -0,0 +1,61 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ReviseName : mount
{
public Button ReviseBtn;
public Text RevisrText;
public Text MainnameText;
// Start is called before the first frame update
void Start()
{
ReviseBtn.onClick.AddListener(ReviseClick);
}
public void ReviseClick()
{
List<BoxType> boxTypes = new List<BoxType>();
boxTypes.Add(new BoxType { Name = "verification_code", textName = " 修改昵称:", prompt = "请输入修改的昵称", Type = 0, is_required = true });
boxTypes.Add(new BoxType { Name = "submit", textName = " 取消确定 ", prompt = "取消", Type = 2 });
GameObject gameObject = add_pop_up(true);//生成弹窗母体
RectTransform rect = gameObject.GetComponent<RectTransform>();
rect.transform.position = new Vector3(Screen.width/2,Screen.height/2,0);
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "修改昵称");//测试输入框回调处理
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
{
if (type == 0)//取消
{
gameObject.GetComponent<input_box_pop_up_window>().destroy();
}
else if (type == 1)//提交
{
Debug.Log(boxTypes[0].content);
UpdatePlayerInfoResponse issuccefful = await Scene_main_jiekou.instance.UpdatePlayerInfos("nickname", boxTypes[0].content);
if (issuccefful.code ==200)
{
Promptmgr.Instance.PromptBubble("修改昵称成功");
RevisrText.text = issuccefful.data.nickname;
MainnameText.text = issuccefful.data.nickname;
gameObject.GetComponent<input_box_pop_up_window>().destroy();
}
else
{
Promptmgr.Instance.PromptBubble(issuccefful.message);
}
}
});
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2911dd3981376da459f4cb5b4a0031c8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -12,6 +12,8 @@ public class Scene_main_jiekou :MonoBehaviour
treeFansList treeFansList = new treeFansList();
treeGetWater getWater = new treeGetWater();
wateringTree watering = new wateringTree();
updatePlayerInfo updatePlayer=new updatePlayerInfo();
cancellation cancellation = new cancellation();
public static Scene_main_jiekou instance;
public PlayerInfoData infoData;
@ -64,4 +66,14 @@ public class Scene_main_jiekou :MonoBehaviour
{
return await watering.WateringTree();
}
public async Task<UpdatePlayerInfoResponse> UpdatePlayerInfos(string field, string value)//呢称需要包含中文可以跟字母组合,但必须大于两个//只能更新名字头像
{
return await updatePlayer.UpdatePlayerInfo(field, value);
}
public async Task<bool> Cancellations()
{
return await cancellation.Cancellation();
}
}

View File

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
using UnityEngine;
//用户信息更新
public class updatePlayerInfo : MonoBehaviour
@ -20,16 +21,27 @@ public class updatePlayerInfo : MonoBehaviour
};
}
//=========用户信息更新=============================================================================
public async Task<bool> UpdatePlayerInfo(string field, string value)//呢称需要包含中文可以跟字母组合,必须大于两个//只能更新名字头像
public async Task<UpdatePlayerInfoResponse> UpdatePlayerInfo(string field, string value)//呢称需要包含中文可以跟字母组合,必须大于两个//只能更新名字头像
{
string body = $"{{\"{field}\":\"{value}\"}}";
//Debug.Log("=====" + body);
string response = await myWeb.SendRequest(myWeb.URL + "/api/user/update_info", "POST", body, CreateHeaders());
Debug.Log("用户信息更新" + response);
//myResponse ModifyTradePasswordResponse = JsonConvert.DeserializeObject<myResponse>(response);
bool isSucceed = true;
//if (ModifyTradePasswordResponse.code == 200) { isSucceed = true; } else { isSucceed = false; }
return isSucceed;
UpdatePlayerInfoResponse updatePlayerInfoResponse = JsonConvert.DeserializeObject<UpdatePlayerInfoResponse>(response);
return updatePlayerInfoResponse;
}
}
//=================================================================================
//=================================================================================
public class UpdatePlayerInfoResponse
{
public int code;
public string message;
public UpdatePlayerInfoData data;
}
public class UpdatePlayerInfoData
{
public string nickname;
public string avatar;
}