接口
This commit is contained in:
parent
98539732b6
commit
e552d26617
@ -13500,6 +13500,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 163049996}
|
||||
- component: {fileID: 163049997}
|
||||
- component: {fileID: 163049998}
|
||||
m_Layer: 0
|
||||
m_Name: jiekou
|
||||
m_TagString: Untagged
|
||||
@ -13534,6 +13535,18 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 768ed40e69788184b804035df928dc51, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &163049998
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 163049995}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59ff8dcd92c3dd54e92e6e06ff63654d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &163450907
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -51,7 +51,7 @@ public class PlayerManager
|
||||
return;
|
||||
}
|
||||
Stones += num;
|
||||
Promptmgr.assestPanel.SetStoneText(Stones);
|
||||
// Promptmgr.assestPanel.SetStoneText(Stones);
|
||||
break;
|
||||
case MoneyType.Forging:
|
||||
if((Forging + num) < 0)
|
||||
@ -60,7 +60,7 @@ public class PlayerManager
|
||||
return;
|
||||
}
|
||||
Forging += num;
|
||||
Promptmgr.assestPanel.SetForgingText(Forging);
|
||||
// Promptmgr.assestPanel.SetForgingText(Forging);
|
||||
break;
|
||||
case MoneyType.Coins:
|
||||
if ((Coins + num) < 0)
|
||||
@ -69,7 +69,7 @@ public class PlayerManager
|
||||
return;
|
||||
}
|
||||
Coins += num;
|
||||
Promptmgr.assestPanel.SetCoinText(Coins);
|
||||
// Promptmgr.assestPanel.SetCoinText(Coins);
|
||||
break;
|
||||
case MoneyType.Ore:
|
||||
if ((Ore + num) < 0)
|
||||
@ -78,7 +78,7 @@ public class PlayerManager
|
||||
return;
|
||||
}
|
||||
Ore += num;
|
||||
Promptmgr.assestPanel.SetOreText(Ore);
|
||||
// Promptmgr.assestPanel.SetOreText(Ore);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -22,17 +22,6 @@ public class AssetsPanel : MonoBehaviour
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
if (Promptmgr.assestPanel == null)
|
||||
{
|
||||
Promptmgr.assestPanel = this;
|
||||
Stone.text = PlayerManager.Instance.Stones.ToString();
|
||||
Forging.text = PlayerManager.Instance.Forging.ToString();
|
||||
Coin.text = PlayerManager.Instance.Coins.ToString();
|
||||
Ore.text = PlayerManager.Instance.Ore.ToString();
|
||||
Promptmgr.assestPanel.is_one = true;
|
||||
}
|
||||
|
||||
|
||||
if (but1 != null)
|
||||
{
|
||||
but1.onClick.AddListener(() => {
|
||||
@ -60,46 +49,21 @@ public class AssetsPanel : MonoBehaviour
|
||||
mygameObject.SetActive(true);
|
||||
});
|
||||
}
|
||||
|
||||
UpdateTaxt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetStoneText(float num)
|
||||
{
|
||||
if (Stone != null)
|
||||
{
|
||||
Stone.text = num.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
public void SetCoinText(float num)
|
||||
async void UpdateTaxt()
|
||||
{
|
||||
if (Coin != null)
|
||||
{
|
||||
Coin.text = num.ToString();
|
||||
}
|
||||
}
|
||||
public void SetOreText(float num)
|
||||
{
|
||||
if (Ore != null)
|
||||
{
|
||||
Ore.text = num.ToString();
|
||||
}
|
||||
}
|
||||
public void SetForgingText(float num)
|
||||
{
|
||||
if (Forging != null)
|
||||
{
|
||||
Forging.text = num.ToString();
|
||||
}
|
||||
PlayerInfoData info=await Scene_main_jiekou.instance.PlayerInfos();
|
||||
Stone.text = info.gem.ToString();
|
||||
Coin.text = info.gold.ToString();
|
||||
Ore.text = info.water.ToString();
|
||||
Forging.text = info.forge.ToString();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
Stone.text = PlayerManager.Instance.Stones.ToString();
|
||||
Coin.text = PlayerManager.Instance.Coins.ToString();
|
||||
Ore.text = PlayerManager.Instance.Ore.ToString();
|
||||
Forging.text = PlayerManager.Instance.Forging.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,16 +7,23 @@ using UnityEngine;
|
||||
public class Scene_main_jiekou :MonoBehaviour
|
||||
{
|
||||
login _Login = new login();
|
||||
public async void Start()
|
||||
{
|
||||
await _Login.TastLogin();
|
||||
await PlayerInfos();
|
||||
}
|
||||
public static Scene_main_jiekou instance;
|
||||
void Awake()
|
||||
{
|
||||
instance=this;
|
||||
}
|
||||
public async void Start()
|
||||
{
|
||||
|
||||
//await PlayerInfos();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<PlayerInfoData> PlayerInfos()
|
||||
{
|
||||
await _Login.TastLogin();
|
||||
|
||||
playerInfo playerInfo=new playerInfo();
|
||||
PlayerIndfo _PlayerIndfo = await playerInfo.PalyerInfo();
|
||||
return _PlayerIndfo.Data;
|
||||
|
@ -52,6 +52,7 @@ public class login : MonoBehaviour
|
||||
//Debug.Log(MyGlobal.global.loginResponse.Data);
|
||||
MyGlobal.global.loginResponse.Data.access_token = apifox.Data.access_token;
|
||||
//Debug.Log(MyGlobal.global.loginResponse.Data.access_token);
|
||||
Debug.Log("测试登入成功,后期记得删");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user