每日自动提交 2026-04-13 18:30
This commit is contained in:
@@ -1655,7 +1655,7 @@ MonoBehaviour:
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4278255577
|
||||
m_fontColor: {r: 0.8509928, g: 1, b: 0, a: 1}
|
||||
m_fontColor: {r: 0, g: 1, b: 0.9250941, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
@@ -1768,6 +1768,7 @@ MonoBehaviour:
|
||||
btn_Close: {fileID: 8274301648789745216}
|
||||
tMPText_Header: {fileID: 118118469195421749}
|
||||
tMPText_Content: {fileID: 8331406854104295500}
|
||||
tMPText_EmailCount: {fileID: 1578311975270780186}
|
||||
btn_Receive: {fileID: 1015959014050646896}
|
||||
btn_Dlete: {fileID: 6610209709396860820}
|
||||
btn_AllDlete: {fileID: 1656486209904210043}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
using Assets.Framework.Tool;
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.API.UserData_SubClass;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -65,7 +66,7 @@ public class UIHome_BY_BackPackPanel : SubUIBase
|
||||
tMP_Description.text = product.desc;
|
||||
}
|
||||
});
|
||||
WebTool.DownImage(product.imageUrl, (texture) =>
|
||||
WebTool.DownImage(APIManager.baseURL+product.imageUrl, (texture) =>
|
||||
{
|
||||
obj.transform.GetChild(0).GetComponent<Image>().sprite = Sprite.Create(texture,new Rect(0f,0f,90,90),Vector2.one*0.5f) ;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public class UIHome_BY_EmailPanel : SubUIBase
|
||||
{
|
||||
public TextMeshProUGUI tMPText_Header;
|
||||
public TextMeshProUGUI tMPText_Content;
|
||||
public TextMeshProUGUI tMPText_EmailCount;
|
||||
public Button btn_Receive;
|
||||
public Button btn_Dlete;
|
||||
public Button btn_AllDlete;
|
||||
@@ -77,6 +78,8 @@ public class UIHome_BY_EmailPanel : SubUIBase
|
||||
dic_GetEmailByPageResponses.Remove(currEmailID);
|
||||
; Destroy(dic_EmalItems[currEmailID].gameObject);
|
||||
dic_EmalItems.Remove(currEmailID);
|
||||
tMPText_EmailCount.text = itemPrefabParent.childCount.ToString();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -117,6 +120,8 @@ public class UIHome_BY_EmailPanel : SubUIBase
|
||||
}
|
||||
}
|
||||
}
|
||||
tMPText_EmailCount.text = itemPrefabParent.childCount.ToString();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -134,6 +139,7 @@ public class UIHome_BY_EmailPanel : SubUIBase
|
||||
{
|
||||
propPrefabParent.GetChild(i).GetChild(1).gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnShow(object args = null)
|
||||
@@ -263,6 +269,7 @@ public class UIHome_BY_EmailPanel : SubUIBase
|
||||
}
|
||||
});
|
||||
}
|
||||
tMPText_EmailCount.text=itemPrefabParent.childCount.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ public class UIHome_BY_MonthCardPanel : SubUIBase
|
||||
base.Awake();
|
||||
btn_Open.onClick.AddListener(() =>
|
||||
{
|
||||
APIRequestList.BuyMonthCard(new BuyMonthCardParam
|
||||
{
|
||||
cardType = 1
|
||||
//APIRequestList.BuyMonthCard(new BuyMonthCardParam
|
||||
//{
|
||||
// cardType = 1
|
||||
|
||||
}, (response) =>
|
||||
{
|
||||
Debug.Log("购买月卡成功,月卡ID:" + response.cardId + ",名称:" + response.name);
|
||||
});
|
||||
//}, (response) =>
|
||||
//{
|
||||
// Debug.Log("购买月卡成功,月卡ID:" + response.cardId + ",名称:" + response.name);
|
||||
//});
|
||||
});
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
|
||||
@@ -1,21 +1,246 @@
|
||||
using System.Collections;
|
||||
using Assets.Framework.Tool;
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using Assets.MyGame.Scripts.Net.APIRequest.Params;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UIHome_BY_ShopPanel : SubUIBase
|
||||
{
|
||||
public GameObject obj_PropPrefab;
|
||||
[Header("左侧按钮")]
|
||||
public Button btn_GlodCoins;
|
||||
public Button btn_Diamond;
|
||||
public Button btn_Prop;
|
||||
public GameObject obj_ItemPrefab; // 0-图标 1-首充 2-购买按钮 2-0-价值 3-名字
|
||||
public Transform tra_PrefabParent;
|
||||
public TextMeshProUGUI tMP_GoldCoinNum;
|
||||
public TextMeshProUGUI tMP_DiamondNum;
|
||||
|
||||
[Header("左侧按钮")]
|
||||
public Toggle btn_GlodCoins;
|
||||
public Toggle btn_Diamond;
|
||||
public Toggle btn_Prop;
|
||||
|
||||
public List< GameObject> vipIcon=new List<GameObject>();
|
||||
Dictionary<string, GoldShopConfig> dic_GoldItems=new Dictionary<string, GoldShopConfig>();
|
||||
Dictionary<string, DiamondShopConfig> dic_DiamondItems=new Dictionary<string, DiamondShopConfig>();
|
||||
Dictionary<string, BasePropInfo> dic_PropItems=new Dictionary<string, BasePropInfo>();
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
}
|
||||
var gameConfig = GameManager.Instance.gameConfig;
|
||||
btn_GlodCoins.onValueChanged.AddListener((a) =>
|
||||
{
|
||||
for (int i = tra_PrefabParent.childCount-1; i >=0; i--)
|
||||
{
|
||||
Destroy(tra_PrefabParent.GetChild(i).gameObject);
|
||||
|
||||
}
|
||||
foreach (var item in gameConfig.goldShopConfigs)
|
||||
{
|
||||
var obj = Instantiate(obj_ItemPrefab, tra_PrefabParent).transform;
|
||||
|
||||
if (item.sprite_Icon==null)
|
||||
{
|
||||
WebTool.DownImage(APIManager.baseURL + item.icon, (texture) =>
|
||||
{
|
||||
item.sprite_Icon = Sprite.Create(texture,new Rect(0,0, texture.width,texture.height),new Vector2(0.5f,0.5f));
|
||||
obj.GetChild(0).GetComponent<Image>().sprite= item.sprite_Icon;
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
}
|
||||
obj.name = item.number;
|
||||
dic_GoldItems[item.number] = item;
|
||||
obj.GetChild(2).GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
//这里调用api
|
||||
APIRequestList.BuyGold(new BuyGoldParam { number = item.number, count = 1 }, (response) =>
|
||||
{
|
||||
UIManager.Instance.ShowBoardError(response);
|
||||
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
tMP_GoldCoinNum.text = GameManager.Instance.user.assets.gold.ToString();
|
||||
tMP_DiamondNum.text = GameManager.Instance.user.assets.diamond.ToString();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text ="\ue002"+item.diamond.ToString();
|
||||
obj.GetChild(3).GetComponent<TextMeshProUGUI>().text = item.gold.ToString();
|
||||
}
|
||||
|
||||
//
|
||||
});
|
||||
btn_Diamond.onValueChanged.AddListener((a) =>
|
||||
{
|
||||
for (int i = tra_PrefabParent.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
Destroy(tra_PrefabParent.GetChild(i).gameObject);
|
||||
|
||||
}
|
||||
foreach (var item in gameConfig.diamondShopConfigs)
|
||||
{
|
||||
var obj = Instantiate(obj_ItemPrefab, tra_PrefabParent).transform;
|
||||
|
||||
if (item.sprite_Icon == null)
|
||||
{
|
||||
WebTool.DownImage(APIManager.baseURL + item.icon, (texture) =>
|
||||
{
|
||||
item.sprite_Icon = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
}
|
||||
obj.name = item.number;
|
||||
dic_DiamondItems[item.number] = item;
|
||||
obj.GetChild(2).GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
//这里调用api
|
||||
APIRequestList.BuyDiamond(new BuyDiamondParam { number = item.number, count = 1 }, (response) =>
|
||||
{
|
||||
UIManager.Instance.ShowBoardError(response);
|
||||
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
tMP_GoldCoinNum.text = GameManager.Instance.user.assets.gold.ToString();
|
||||
tMP_DiamondNum.text = GameManager.Instance.user.assets.diamond.ToString();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = item.money.ToString()+"元";
|
||||
obj.GetChild(3).GetComponent<TextMeshProUGUI>().text = item.diamond.ToString();
|
||||
}
|
||||
|
||||
//
|
||||
});
|
||||
btn_Prop.onValueChanged.AddListener((a) =>
|
||||
{
|
||||
for (int i = tra_PrefabParent.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
Destroy(tra_PrefabParent.GetChild(i).gameObject);
|
||||
}
|
||||
foreach (var item in gameConfig.propConfig)
|
||||
{
|
||||
if (item.isSale == false || item.isEnable == false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var obj = Instantiate(obj_ItemPrefab, tra_PrefabParent).transform;
|
||||
|
||||
if (item.sprite_Icon == null)
|
||||
{
|
||||
WebTool.DownImage(APIManager.baseURL + item.imageUrl, (texture) =>
|
||||
{
|
||||
item.sprite_Icon = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
}
|
||||
obj.name = item.number;
|
||||
dic_PropItems[item.number] = item;
|
||||
obj.GetChild(2).GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
//这里调用api
|
||||
APIRequestList.BuyProp(new BuyPropParam { propNumber = item.number, count = 1 }, (response) =>
|
||||
{
|
||||
UIManager.Instance.ShowBoardError(response);
|
||||
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
tMP_GoldCoinNum.text = GameManager.Instance.user.assets.gold.ToString();
|
||||
tMP_DiamondNum.text = GameManager.Instance.user.assets.diamond.ToString();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
obj.GetChild(3).GetComponent<TextMeshProUGUI>().text = item.name.ToString();
|
||||
if (item.saleType == 1)
|
||||
{
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "\ue001" + item.price.ToString();
|
||||
|
||||
}
|
||||
else if (item.saleType == 2)
|
||||
{
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "\ue002" + item.price.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
foreach (var item in gameConfig.propFragments)
|
||||
{
|
||||
if (item.isSale==false||item.isEnable==false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var obj = Instantiate(obj_ItemPrefab, tra_PrefabParent).transform;
|
||||
|
||||
if (item.sprite_Icon == null)
|
||||
{
|
||||
WebTool.DownImage(APIManager.baseURL + item.imageUrl, (texture) =>
|
||||
{
|
||||
item.sprite_Icon = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.GetChild(0).GetComponent<Image>().sprite = item.sprite_Icon;
|
||||
}
|
||||
obj.name = item.number;
|
||||
dic_PropItems[item.number] = item;
|
||||
obj.GetChild(2).GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
//这里调用api
|
||||
APIRequestList.BuyProp(new BuyPropParam { propNumber = item.number, count = 1 }, (response) =>
|
||||
{
|
||||
UIManager.Instance.ShowBoardError(response);
|
||||
|
||||
APIRequestList.GetUser(GameManager.Instance.user.id, (a) =>
|
||||
{
|
||||
GameManager.Instance.UpdataUserData(a);
|
||||
tMP_GoldCoinNum.text = GameManager.Instance.user.assets.gold.ToString();
|
||||
tMP_DiamondNum.text = GameManager.Instance.user.assets.diamond.ToString();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
obj.GetChild(3).GetComponent<TextMeshProUGUI>().text = item.name.ToString();
|
||||
if (item.saleType == 1)
|
||||
{
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "\ue001" + item.price.ToString();
|
||||
|
||||
}
|
||||
else if (item.saleType == 2)
|
||||
{
|
||||
obj.GetChild(2).GetChild(0).GetComponent<TextMeshProUGUI>().text = "\ue002" + item.price.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
});
|
||||
}
|
||||
protected override void OnShow(object args = null)
|
||||
{
|
||||
base.OnShow(args);
|
||||
tMP_GoldCoinNum.text = GameManager.Instance.user.assets.gold.ToString();
|
||||
tMP_DiamondNum.text = GameManager.Instance.user.assets.diamond.ToString();
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user