Compare commits

...

2 Commits

7 changed files with 399 additions and 259 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,10 @@ public class AssetsPanel : MonoBehaviour
public Text Coin; public Text Coin;
public Text Ore; public Text Ore;
public Text Forging; public Text Forging;
public Text UserName;
public Text UserID;
public Image UserHead;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -59,10 +63,13 @@ public class AssetsPanel : MonoBehaviour
async void UpdateTaxt() async void UpdateTaxt()
{ {
PlayerInfoData info=await Scene_main_jiekou.instance.PlayerInfos(); PlayerInfoData info=await Scene_main_jiekou.instance.PlayerInfos();
Stone.text = info.gem.ToString(); Stone.text = Scene_main_jiekou.instance.infoData.gem.ToString();
Coin.text = info.gold.ToString(); Coin.text = Scene_main_jiekou.instance.infoData.gold.ToString();
Ore.text = info.water.ToString(); Ore.text = Scene_main_jiekou.instance.infoData.water.ToString();
Forging.text = info.forge.ToString(); Forging.text = Scene_main_jiekou.instance.infoData.forge.ToString();
UserName.text = Scene_main_jiekou.instance.infoData.nickname.ToString();
UserID.text = Scene_main_jiekou.instance.infoData.uid.ToString();
} }

View File

@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InfoPanel : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

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

View File

@ -7,15 +7,23 @@ using UnityEngine;
public class Scene_main_jiekou :MonoBehaviour public class Scene_main_jiekou :MonoBehaviour
{ {
login _Login = new login(); login _Login = new login();
treeInfo TreeInfoss = new treeInfo();
treeTeamData teamData = new treeTeamData();
treeFansList treeFansList = new treeFansList();
treeGetWater getWater = new treeGetWater();
wateringTree watering = new wateringTree();
public static Scene_main_jiekou instance; public static Scene_main_jiekou instance;
void Awake() public PlayerInfoData infoData;
public void Awake()
{ {
instance=this; instance=this;
} }
public async void Start() public async void Start()
{ {
//await PlayerInfos();
} }
@ -23,9 +31,37 @@ public class Scene_main_jiekou :MonoBehaviour
public async Task<PlayerInfoData> PlayerInfos() public async Task<PlayerInfoData> PlayerInfos()
{ {
await _Login.TastLogin(); await _Login.TastLogin();
playerInfo playerInfo=new playerInfo();
playerInfo playerInfo=new playerInfo();
PlayerIndfo _PlayerIndfo = await playerInfo.PalyerInfo(); PlayerIndfo _PlayerIndfo = await playerInfo.PalyerInfo();
infoData = _PlayerIndfo.Data;
return _PlayerIndfo.Data; return _PlayerIndfo.Data;
} }
}
public async Task<TreeInfo> TreeInfoS()//生态树信息
{
return await TreeInfoss.TreeInfo();
}
public async Task<TreeTeam> TreeTeamDatas()//生态树团队信息
{
return await teamData.TreeTeamData();
}
public async Task<TreeFansListResponse> TreeFansListS()//生态树团队粉丝列表
{
return await treeFansList.TreeFansList();
}
public async Task<bool> TreeGetWaters(int index, string transId)//生态树水滴采集
{
treeGetWaterBody body = new treeGetWaterBody();
body.index = index;
body.transId = transId;
bool isSuccefful = await getWater.TreeGetWater(body);
return isSuccefful;
}
public async Task<WateringTreeResponse> WateringTrees()//生态树浇水
{
return await watering.WateringTree();
}
}

View File

@ -20,11 +20,11 @@ public class treeGetWater : MonoBehaviour
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" } { "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
}; };
} }
public async Task<bool> TreeGetWater(int index,string transId) public async Task<bool> TreeGetWater(treeGetWaterBody body)
{ {
treeGetWaterBody body = new treeGetWaterBody(); //treeGetWaterBody body = new treeGetWaterBody();
body.index = index; //body.index = index;
body.transId = transId; //body.transId = transId;
string response = await myWeb.SendRequest(myWeb.URL + "/api/tree/gather", "POST", JsonConvert.SerializeObject(body), CreateHeaders()); string response = await myWeb.SendRequest(myWeb.URL + "/api/tree/gather", "POST", JsonConvert.SerializeObject(body), CreateHeaders());
Debug.Log("生态树水滴采集" + response); Debug.Log("生态树水滴采集" + response);
//bbbb //bbbb

View File

@ -20,7 +20,7 @@ public class treeInfo : MonoBehaviour
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" } { "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
}; };
} }
public async Task<TreeInfo> TreeInfo()//ÀàÐÍ 0:±¦Ê¯µº 1:±¦Ê¯¿ó³¡ 10:½ð±Òµº 11:½ð±Ò¿ó³¡ public async Task<TreeInfo> TreeInfo()
{ {
string response = await myWeb.SendRequest(myWeb.URL + "/api/tree/info", "GET", "{}", CreateHeaders()); string response = await myWeb.SendRequest(myWeb.URL + "/api/tree/info", "GET", "{}", CreateHeaders());
Debug.Log("Éú̬Ê÷ÐÅÏ¢" + response); Debug.Log("Éú̬Ê÷ÐÅÏ¢" + response);