Merge branch 'main' of http://shu.sheziwanglo.cn:3000/shurongsen/Cute_demon_attacks
This commit is contained in:
commit
9a69d23e3c
File diff suppressed because it is too large
Load Diff
@ -79,7 +79,7 @@ MonoBehaviour:
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: 4
|
||||
m_Text:
|
||||
--- !u!1 &1908348282893993410
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -402,6 +402,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1908348284012044740}
|
||||
- component: {fileID: 3461516469826489107}
|
||||
m_Layer: 5
|
||||
m_Name: players
|
||||
m_TagString: Untagged
|
||||
@ -433,6 +434,23 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: -0.011657715, y: 517.78}
|
||||
m_SizeDelta: {x: 1080, y: 220.73}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &3461516469826489107
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1908348284012044747}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a8534ac41d2237341ad7afa395ddb9c1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Rankingtext: {fileID: 716069678}
|
||||
userImage: {fileID: 1908348282911385789}
|
||||
username: {fileID: 1908348283343277311}
|
||||
prize: {fileID: 1908348284013975805}
|
||||
count: {fileID: 1908348282893993020}
|
||||
--- !u!1 &1908348284013975683
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -33,6 +33,8 @@ public class Battle_Selection : BaseUI
|
||||
|
||||
public Button tiaoScene;
|
||||
|
||||
public List<Button> Btns;
|
||||
|
||||
// Start is called before the first frame update
|
||||
async void Start()
|
||||
{
|
||||
@ -158,4 +160,22 @@ public class Battle_Selection : BaseUI
|
||||
// 开始动画
|
||||
mySequence.Play();
|
||||
}
|
||||
public void ShowCardOfShuixing(int shuxing)
|
||||
{
|
||||
foreach (Button key in MengyaoCard)
|
||||
{
|
||||
if (shuxing==-1)
|
||||
{
|
||||
key.gameObject.SetActive(true);
|
||||
}
|
||||
else if (key.GetComponent<CardInfo>().shuxing == shuxing)
|
||||
{
|
||||
key.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
key.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,5 @@ using UnityEngine;
|
||||
public class CardInfo : MonoBehaviour
|
||||
{
|
||||
public string mengyaoid;
|
||||
[Header("属性")]public int shuxing;
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ public class Asset_Details : MonoBehaviour
|
||||
|
||||
public GameObject itemPrefab;
|
||||
// Start is called before the first frame update
|
||||
|
||||
|
||||
public Button GiveawayBtn;
|
||||
|
||||
/// <summary>
|
||||
/// 瑯데
|
||||
@ -38,15 +38,19 @@ public class Asset_Details : MonoBehaviour
|
||||
{
|
||||
case 1:
|
||||
initPanel("괜柯固셕", info.Income,info.Expend,info.Balance);
|
||||
GiveawayBtn.gameObject.SetActive(false);
|
||||
break;
|
||||
case 2:
|
||||
initPanel("쏜귑固셕", info.Income, info.Expend, info.Balance);
|
||||
GiveawayBtn.gameObject.SetActive(true);
|
||||
break;
|
||||
case 3:
|
||||
initPanel("彊두固셕", info.Income, info.Expend, info.Balance);
|
||||
GiveawayBtn.gameObject.SetActive(false);
|
||||
break;
|
||||
case 4:
|
||||
initPanel("똴芚즈固셕", info.Income, info.Expend, info.Balance);
|
||||
GiveawayBtn.gameObject.SetActive(false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
public class Promotion_Rank : MonoBehaviour
|
||||
@ -23,22 +24,83 @@ public class Promotion_Rank : MonoBehaviour
|
||||
|
||||
public GameObject Promotionitem;
|
||||
public Transform Content;
|
||||
|
||||
public Text countdown;
|
||||
List<GameObject> Items = new List<GameObject>();
|
||||
// Start is called before the first frame update
|
||||
async void Start()
|
||||
|
||||
float remainingTime=0f;
|
||||
void OnEnable()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
async void Init()
|
||||
{
|
||||
PromotionRankResponse response = await Scene_main_jiekou.instance.PromotionRanks();
|
||||
//FirstName.text = response.data.ranks[0].nickname;
|
||||
//Firstcount.text = response.data.ranks[0].quantity + "/" + response.data.ranks[0].require;
|
||||
//SecondName.text = response.data.ranks[1].nickname;
|
||||
//Secondcount.text = response.data.ranks[1].quantity+"/" + response.data.ranks[1].require;
|
||||
//ThirdName.text = response.data.ranks[2].nickname;
|
||||
//Thirdcount.text = response.data.ranks[2].quantity + "/" + response.data.ranks[2].require;
|
||||
|
||||
Firstlevel.text = response.data.ranks[0].rank.ToString();
|
||||
FirstName.text = response.data.ranks[0].nickname;
|
||||
Firstcount.text = response.data.ranks[0].quantity + "/" + response.data.ranks[0].require;
|
||||
FitstPrize.text = response.data.ranks[0].reward.ToString();
|
||||
|
||||
|
||||
Secondlevel.text = response.data.ranks[1].rank.ToString();
|
||||
SecondName.text = response.data.ranks[1].nickname;
|
||||
Secondcount.text = response.data.ranks[1].quantity + "/" + response.data.ranks[1].require;
|
||||
SecondPrize.text = response.data.ranks[1].reward.ToString();
|
||||
|
||||
Thirdlevel.text = response.data.ranks[2].rank.ToString();
|
||||
ThirdName.text = response.data.ranks[2].nickname;
|
||||
Thirdcount.text = response.data.ranks[2].quantity + "/" + response.data.ranks[2].require;
|
||||
ThirdPrize.text = response.data.ranks[2].reward.ToString();
|
||||
|
||||
remainingTime = response.data.countdown;
|
||||
|
||||
for (int i = 3; i < response.data.ranks.Count; i++)
|
||||
{
|
||||
GameObject obj = Instantiate(Promotionitem,Content);
|
||||
Items.Add(obj);
|
||||
obj.GetComponent<Promotion_Rankitem>().Rankingtext.text = response.data.ranks[i].rank.ToString();
|
||||
obj.GetComponent<Promotion_Rankitem>().username.text = response.data.ranks[i].nickname;
|
||||
obj.GetComponent<Promotion_Rankitem>().prize.text = response.data.ranks[i].reward+"元现金奖励";
|
||||
obj.GetComponent<Promotion_Rankitem>().count.text = response.data.ranks[i].quantity + "/" + response.data.ranks[i].require;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void UpdateCountdownText(float remainingTime)
|
||||
{
|
||||
// 将剩余时间转换为小时、分钟和秒
|
||||
int hours = Mathf.FloorToInt(remainingTime / 3600);
|
||||
int minutes = Mathf.FloorToInt((remainingTime % 3600) / 60);
|
||||
int seconds = Mathf.FloorToInt(remainingTime % 60);
|
||||
|
||||
// 使用格式化字符串显示倒计时(00:00:00)
|
||||
countdown.text = string.Format("{0:D2}:{1:D2}:{2:D2}", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (remainingTime > 0)
|
||||
{
|
||||
// 每帧减少剩余时间
|
||||
remainingTime -= Time.deltaTime;
|
||||
|
||||
// 更新倒计时显示
|
||||
UpdateCountdownText(remainingTime);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
private void OnDisable()
|
||||
{
|
||||
|
||||
foreach (GameObject item in Items)
|
||||
{
|
||||
Destroy(item);
|
||||
}
|
||||
Items.Clear();
|
||||
}
|
||||
}
|
||||
|
22
meng_yao/Assets/script/scene_Main/ui/BTN.cs
Normal file
22
meng_yao/Assets/script/scene_Main/ui/BTN.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class BTN : MonoBehaviour
|
||||
{
|
||||
public Button btn;
|
||||
|
||||
public int shuxing;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
btn.onClick.AddListener(() => { });
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
meng_yao/Assets/script/scene_Main/ui/BTN.cs.meta
Normal file
11
meng_yao/Assets/script/scene_Main/ui/BTN.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a239e3f38bf08354688a0bc0445d3622
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
23
meng_yao/Assets/script/scene_Main/ui/Promotion_Rankitem.cs
Normal file
23
meng_yao/Assets/script/scene_Main/ui/Promotion_Rankitem.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Promotion_Rankitem : MonoBehaviour
|
||||
{
|
||||
public Text Rankingtext;
|
||||
public Image userImage;
|
||||
public Text username;
|
||||
public Text prize;
|
||||
public Text count;
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8534ac41d2237341ad7afa395ddb9c1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user