Compare commits
4 Commits
b62560c885
...
55e8940b48
Author | SHA1 | Date | |
---|---|---|---|
55e8940b48 | |||
e0f07a4aaf | |||
73d6cd84b7 | |||
59f00059a1 |
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@ public class WaterPanel : MonoBehaviour
|
|||||||
public Texture NightSp;
|
public Texture NightSp;
|
||||||
public List<GameObject> Treelist = new List<GameObject>();
|
public List<GameObject> Treelist = new List<GameObject>();
|
||||||
public List<GameObject> ChineseZodiac = new List<GameObject>();
|
public List<GameObject> ChineseZodiac = new List<GameObject>();
|
||||||
|
public List<GameObject> Schedulelist;
|
||||||
|
|
||||||
public Text chart_title;
|
public Text chart_title;
|
||||||
|
|
||||||
@ -60,16 +61,24 @@ public class WaterPanel : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
InvokeRepeating("Updated_water", 1f, 1f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
CancelInvoke("Updated_water");
|
||||||
|
}
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
async void Start()
|
async void Start()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
Updated_water();
|
||||||
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
||||||
Updated_interface(info);
|
Updated_interface(info);
|
||||||
Updated_water(info);
|
|
||||||
petBettleInfoResponse petinfo = await Scene_main_jiekou.instance.getPetBettleInfos();
|
petBettleInfoResponse petinfo = await Scene_main_jiekou.instance.getPetBettleInfos();
|
||||||
Updated_petinfo(petinfo);
|
Updated_petinfo(petinfo);
|
||||||
PlayerInfoData playerinfo = await Scene_main_jiekou.instance.PlayerInfos();
|
PlayerInfoData playerinfo = await Scene_main_jiekou.instance.PlayerInfos();
|
||||||
@ -95,6 +104,15 @@ public class WaterPanel : MonoBehaviour
|
|||||||
Updated_Tree(info.Data.Level);
|
Updated_Tree(info.Data.Level);
|
||||||
LevelShow.text = info.Data.Exp + "/" + info.Data.upgrade_exp;
|
LevelShow.text = info.Data.Exp + "/" + info.Data.upgrade_exp;
|
||||||
TreeExpFill.fillAmount =(float)info.Data.Exp / info.Data.upgrade_exp;
|
TreeExpFill.fillAmount =(float)info.Data.Exp / info.Data.upgrade_exp;
|
||||||
|
for (int i = 0; i < info.Data.Charts.Count; i++)
|
||||||
|
{
|
||||||
|
if (info.Data.Charts[i].status == 2)
|
||||||
|
{
|
||||||
|
Schedulelist[i].gameObject.SetActive(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Debug.Log(TreeExpFill.fillAmount);
|
Debug.Log(TreeExpFill.fillAmount);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -141,9 +159,10 @@ public class WaterPanel : MonoBehaviour
|
|||||||
Treelist[4].SetActive(false);
|
Treelist[4].SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Updated_water(TreeInfo info)//更新水滴数据
|
public async void Updated_water()//¸üÐÂË®µÎÊý¾Ý
|
||||||
{
|
{
|
||||||
waterCountText.text = info.Data.Water.ToString("F2");
|
CapitalbalanceIndefo CapitalbalanceData = await Scene_main_jiekou.instance.CapitalbalanceInfos();
|
||||||
|
waterCountText.text = CapitalbalanceData.data.water.ToString("F2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public class Lottery : MonoBehaviour
|
|||||||
Update_itemClick();
|
Update_itemClick();
|
||||||
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
||||||
WaterText.text = info.Data.Water.ToString();
|
WaterText.text = info.Data.Water.ToString();
|
||||||
WaterPanel.instance.Updated_water(info);
|
WaterPanel.instance.Updated_water();
|
||||||
Debug.Log(response);
|
Debug.Log(response);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -21,7 +21,7 @@ public class FeedBtn : MonoBehaviour
|
|||||||
Promptmgr.Instance.PromptBubble(response.message);
|
Promptmgr.Instance.PromptBubble(response.message);
|
||||||
petBettleInfoResponse info = await Scene_main_jiekou.instance.getPetBettleInfos();
|
petBettleInfoResponse info = await Scene_main_jiekou.instance.getPetBettleInfos();
|
||||||
TreeInfo treeinfo = await Scene_main_jiekou.instance.TreeInfoS();
|
TreeInfo treeinfo = await Scene_main_jiekou.instance.TreeInfoS();
|
||||||
WaterPanel.instance.Updated_water(treeinfo);
|
WaterPanel.instance.Updated_water();
|
||||||
WaterPanel.instance.Updated_petinfo(info);
|
WaterPanel.instance.Updated_petinfo(info);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class WaterDrop : MonoBehaviour
|
|||||||
transform.DOScale(new Vector3(0.5f, 0.5f, 0.5f), 0.5f).OnComplete(() =>
|
transform.DOScale(new Vector3(0.5f, 0.5f, 0.5f), 0.5f).OnComplete(() =>
|
||||||
{
|
{
|
||||||
transform.DOScale(Vector3.one, 0.5f);
|
transform.DOScale(Vector3.one, 0.5f);
|
||||||
WaterPanel.instance.Updated_water(info);
|
WaterPanel.instance.Updated_water();
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -20,7 +20,7 @@ public class WateringBtn : MonoBehaviour
|
|||||||
Debug.Log("浇水成功");
|
Debug.Log("浇水成功");
|
||||||
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
|
||||||
WaterPanel.instance. Updated_interface(info);
|
WaterPanel.instance. Updated_interface(info);
|
||||||
WaterPanel.instance.Updated_water(info);
|
WaterPanel.instance.Updated_water();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -20,8 +20,8 @@ public class IllustrationsAssetDetails : MonoBehaviour
|
|||||||
private bool isUpdating = false;
|
private bool isUpdating = false;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
Updatatasset();
|
||||||
UpDateText();
|
UpDateText();
|
||||||
|
|
||||||
if (Genbtn != null)
|
if (Genbtn != null)
|
||||||
{
|
{
|
||||||
Genbtn.onClick.AddListener(() =>
|
Genbtn.onClick.AddListener(() =>
|
||||||
@ -46,13 +46,17 @@ public class IllustrationsAssetDetails : MonoBehaviour
|
|||||||
UpdateTaxt();
|
UpdateTaxt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async void Updatatasset()
|
||||||
|
{
|
||||||
|
CapitalbalanceIndefo CapitalbalanceData = await Scene_main_jiekou.instance.CapitalbalanceInfos();
|
||||||
|
GemText.text = CapitalbalanceData.data.gem.ToString("F2");
|
||||||
|
WaterText.text = CapitalbalanceData.data.water.ToString("F2");
|
||||||
|
}
|
||||||
|
|
||||||
async void UpdateTaxt()
|
async void UpdateTaxt()
|
||||||
{
|
{
|
||||||
isUpdating = true;
|
isUpdating = true;
|
||||||
|
|
||||||
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
|
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
|
||||||
GemText.text = _PlayerInfoData.gem.ToString("F2");
|
|
||||||
WaterText.text = _PlayerInfoData.water.ToString("F2");
|
|
||||||
UserName.text = _PlayerInfoData.nickname.ToString();
|
UserName.text = _PlayerInfoData.nickname.ToString();
|
||||||
UserID.text = _PlayerInfoData.uid.ToString();
|
UserID.text = _PlayerInfoData.uid.ToString();
|
||||||
UserHead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(_PlayerInfoData.avatar_url);
|
UserHead.sprite = await Scene_main_jiekou.instance.ImageLoaderSprite(_PlayerInfoData.avatar_url);
|
||||||
@ -63,12 +67,14 @@ public class IllustrationsAssetDetails : MonoBehaviour
|
|||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
InvokeRepeating("UpDateText", 1f, 1f);
|
InvokeRepeating("UpDateText", 5f, 1f);
|
||||||
|
InvokeRepeating("Updatatasset", 2f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
CancelInvoke("UpDateText");
|
CancelInvoke("UpDateText");
|
||||||
|
CancelInvoke("Updatatasset");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,10 +48,10 @@ public class ShopAssetDetails : MonoBehaviour
|
|||||||
{
|
{
|
||||||
isUpdating = true;
|
isUpdating = true;
|
||||||
|
|
||||||
PlayerInfoData _PlayerInfoData = await Scene_main_jiekou.instance.PlayerInfos();
|
CapitalbalanceIndefo CapitalbalanceData = await Scene_main_jiekou.instance.CapitalbalanceInfos();
|
||||||
GemText .text = _PlayerInfoData.gem.ToString("F2");
|
GemText .text = CapitalbalanceData.data.gem.ToString("F2");
|
||||||
OreText.text = _PlayerInfoData.forge.ToString("F2");
|
OreText.text = CapitalbalanceData.data.forge.ToString("F2");
|
||||||
_PlayerInfoData = null;
|
CapitalbalanceData = null;
|
||||||
// 异步操作完成,标记为未执行
|
// 异步操作完成,标记为未执行
|
||||||
isUpdating = false;
|
isUpdating = false;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,30 @@
|
|||||||
|
using DG.Tweening;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Unity.VisualScripting.Antlr3.Runtime;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class ShopScroll : MonoBehaviour
|
public class ShopScroll : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public RectTransform[] SkincategoryButtons; // 所有分类按钮的 RectTransform
|
||||||
|
public RectTransform[] MycategoryButtons; // 所有分类按钮的 RectTransform
|
||||||
|
|
||||||
|
public Vector2 SkinopenPosition; // 按钮展开时的位置(例如,按钮的目标位置)
|
||||||
|
public Vector2 MyopenPosition; // 按钮展开时的位置(例如,按钮的目标位置)
|
||||||
|
|
||||||
|
public Vector2 closedPosition; // 按钮收起时的位置(例如,按钮完全在屏幕外面)
|
||||||
|
public Vector2 myclosedPosition;
|
||||||
|
|
||||||
|
public float slideDuration = 0.5f; // 滑动的时间
|
||||||
|
public float delayBetweenButtons = 0.1f; // 按钮之间的延迟
|
||||||
|
|
||||||
|
private bool isSkinOpen = false; // 按钮是否展开的状态
|
||||||
|
private bool isMyOpen = false;
|
||||||
|
|
||||||
|
|
||||||
public Button GemBtn;
|
public Button GemBtn;
|
||||||
public Button oreBtn;
|
public Button oreBtn;
|
||||||
public Button lingpaiBtn;
|
public Button lingpaiBtn;
|
||||||
@ -94,9 +114,9 @@ public class ShopScroll : MonoBehaviour
|
|||||||
HidePropertyScroll();
|
HidePropertyScroll();
|
||||||
PropertySoilHideScroll();
|
PropertySoilHideScroll();
|
||||||
HideMyScroll();
|
HideMyScroll();
|
||||||
|
SkinCloseButtons(SkincategoryButtons);
|
||||||
|
MyCloseButtons(MycategoryButtons);
|
||||||
gemmage.sprite = Checked;
|
gemmage.sprite = Checked;
|
||||||
Propertybtnlist.gameObject.SetActive(false);
|
|
||||||
myBtnlist.gameObject.SetActive(false);
|
|
||||||
Gemscroll.gameObject.SetActive(true);
|
Gemscroll.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,9 +125,9 @@ public class ShopScroll : MonoBehaviour
|
|||||||
HidePropertyScroll();
|
HidePropertyScroll();
|
||||||
PropertySoilHideScroll();
|
PropertySoilHideScroll();
|
||||||
HideMyScroll();
|
HideMyScroll();
|
||||||
|
SkinCloseButtons(SkincategoryButtons);
|
||||||
|
MyCloseButtons(MycategoryButtons);
|
||||||
oreImage.sprite = Checked;
|
oreImage.sprite = Checked;
|
||||||
Propertybtnlist.gameObject.SetActive(false);
|
|
||||||
myBtnlist.gameObject.SetActive(false);
|
|
||||||
OreScroll.gameObject.SetActive(true);
|
OreScroll.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,21 +136,23 @@ public class ShopScroll : MonoBehaviour
|
|||||||
HidePropertyScroll();
|
HidePropertyScroll();
|
||||||
PropertySoilHideScroll();
|
PropertySoilHideScroll();
|
||||||
HideMyScroll();
|
HideMyScroll();
|
||||||
|
SkinCloseButtons(SkincategoryButtons);
|
||||||
|
MyCloseButtons(MycategoryButtons);
|
||||||
lingpaiImage.sprite = Checked;
|
lingpaiImage.sprite = Checked;
|
||||||
Propertybtnlist.gameObject.SetActive(false);
|
|
||||||
myBtnlist.gameObject.SetActive(false);
|
|
||||||
lingpaiScroll.gameObject.SetActive(true);
|
lingpaiScroll.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mengyaoClick()
|
void mengyaoClick()
|
||||||
{
|
{
|
||||||
HidePropertyScroll();
|
HidePropertyScroll();
|
||||||
PropertySoilHideScroll();
|
PropertySoilHideScroll();
|
||||||
HideMyScroll();
|
HideMyScroll();
|
||||||
|
SkinCloseButtons(SkincategoryButtons);
|
||||||
|
MyOpenButtons(MycategoryButtons);
|
||||||
mengyaoImage.sprite = Checked;
|
mengyaoImage.sprite = Checked;
|
||||||
Propertybtnlist.gameObject.SetActive(false);
|
|
||||||
myBtnlist.gameObject.SetActive(true);
|
|
||||||
MengyaoScroll.gameObject.SetActive(true);
|
MengyaoScroll.gameObject.SetActive(true);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void skinClick()
|
void skinClick()
|
||||||
@ -138,10 +160,12 @@ public class ShopScroll : MonoBehaviour
|
|||||||
HidePropertyScroll();
|
HidePropertyScroll();
|
||||||
PropertySoilHideScroll();
|
PropertySoilHideScroll();
|
||||||
HideMyScroll();
|
HideMyScroll();
|
||||||
|
MyCloseButtons(MycategoryButtons);
|
||||||
|
SkinOpenButtons(SkincategoryButtons);
|
||||||
skinImage.sprite = Checked;
|
skinImage.sprite = Checked;
|
||||||
SkinScroll.gameObject.SetActive(true);
|
SkinScroll.gameObject.SetActive(true);
|
||||||
myBtnlist.gameObject.SetActive(false);
|
|
||||||
Propertybtnlist.gameObject.SetActive(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyGoldClick()
|
void PropertyGoldClick()
|
||||||
@ -277,8 +301,62 @@ public class ShopScroll : MonoBehaviour
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
// 展开按钮
|
||||||
|
void SkinOpenButtons(RectTransform[] cateButtons)
|
||||||
|
{
|
||||||
|
Propertybtnlist.gameObject.SetActive(true);
|
||||||
|
for (int i =1; i <= cateButtons.Length; i++)
|
||||||
|
{
|
||||||
|
// 为每个按钮设置延迟,按顺序展开
|
||||||
|
cateButtons[i-1].DOAnchorPos(i* SkinopenPosition, slideDuration).SetEase(Ease.OutCubic).SetDelay(i * delayBetweenButtons);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收起按钮
|
||||||
|
async void SkinCloseButtons(RectTransform[] cateButtons)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < cateButtons.Length; i++)
|
||||||
|
{
|
||||||
|
cateButtons[i].DOAnchorPos(closedPosition, slideDuration)
|
||||||
|
.SetEase(Ease.InCubic)
|
||||||
|
.SetDelay(i * delayBetweenButtons);
|
||||||
|
}
|
||||||
|
await Task.Delay(800);
|
||||||
|
Propertybtnlist.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyOpenButtons(RectTransform[] cateButtons)
|
||||||
|
{
|
||||||
|
cateButtons[cateButtons.Length - 1].DOAnchorPos(new Vector2(0, -1155), slideDuration).SetEase(Ease.InCubic);
|
||||||
|
myBtnlist.gameObject.SetActive(true);
|
||||||
|
for (int i = 1; i <cateButtons.Length; i++)
|
||||||
|
{
|
||||||
|
// 为每个按钮设置延迟,按顺序展开
|
||||||
|
cateButtons[i - 1].DOAnchorPos(i * MyopenPosition, slideDuration).SetEase(Ease.OutCubic).SetDelay(i * delayBetweenButtons);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收起按钮
|
||||||
|
async void MyCloseButtons(RectTransform[] cateButtons)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < cateButtons.Length-1; i++)
|
||||||
|
{
|
||||||
|
// 为每个按钮设置延迟,按顺序展开
|
||||||
|
cateButtons[i - 1].DOAnchorPos(i * MyopenPosition, slideDuration)
|
||||||
|
.SetEase(Ease.OutCubic)
|
||||||
|
.SetDelay(i * delayBetweenButtons);
|
||||||
|
}
|
||||||
|
// 最后一个按钮的动画
|
||||||
|
cateButtons[cateButtons.Length - 1].DOAnchorPos(new Vector2(0, -597), slideDuration).SetEase(Ease.InCubic);
|
||||||
|
await Task.Delay(500);
|
||||||
|
myBtnlist.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,5 +57,7 @@ public class TreeInfoReward
|
|||||||
public class TreeInfoChart
|
public class TreeInfoChart
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public int status;
|
||||||
public string Reward { get; set; }
|
public string Reward { get; set; }
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user