宠物成就信息接口的完成

This commit is contained in:
liuliang 2025-01-07 17:28:25 +08:00
parent 19c24d4307
commit 01377e0f18
9 changed files with 1335 additions and 493 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 3db4e336af2a6b44fbaf161e1ee8eb2f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -24,6 +24,7 @@ public class Lottery : MonoBehaviour
{
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
WaterText.text = info.Data.Water.ToString();
Update_itemClick();
}
@ -31,7 +32,6 @@ public class Lottery : MonoBehaviour
{
LotteryBtn.onClick.AddListener(LotteryClick);
ClosefightingBtn.onClick.AddListener(CloseBtnClick);
Update_itemClick();
}
@ -58,7 +58,6 @@ public class Lottery : MonoBehaviour
{
GameObject obj = GameObject.Instantiate(petItem, Connect);
objitem.Add(obj);
obj.GetComponent<PetCard>().petName.text = info.data.items[i].name;
obj.GetComponent<PetCard>().petFightingBtn.id = info.data.items[i].id;
obj.GetComponent<PetCard>().petimage.sprite = showSprite(info.data.items[i].name);
@ -98,6 +97,11 @@ public class Lottery : MonoBehaviour
}
objitem.Clear();
fightinglist.Clear();
foreach (GameObject obj in ExuExhibitmusklist)
{
Destroy(obj);
}
ExuExhibitmusklist.Clear();
Update_itemClick();
TreeInfo info = await Scene_main_jiekou.instance.TreeInfoS();
WaterText.text = info.Data.Water.ToString();
@ -108,9 +112,22 @@ public class Lottery : MonoBehaviour
{
Promptmgr.Instance.PromptBubble("Ë®µÎÓà¶î²»×ã");
}
}
private void OnDisable()
{
foreach (GameObject ob in objitem)
{
Destroy(ob);
}
objitem.Clear();
foreach (GameObject obj in ExuExhibitmusklist)
{
Destroy(obj);
}
ExuExhibitmusklist.Clear();
fightinglist.Clear();
}
// Update is called once per frame
void Update()
{

View File

@ -133,9 +133,6 @@ public class Promotion_Rank : MonoBehaviour
}
private void Update()
{
if (Time.time - lastCallTime >= interval)

View File

@ -32,6 +32,7 @@ public class TransfersurenPanel : MonoBehaviour
WaterPanel.instance.Updated_petinfo(petinfo);
Destroy(this.gameObject);
Promptmgr.Instance.PromptBubble(response.message);
}
else
{

View File

@ -1,6 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
public class treeachievePanel : MonoBehaviour
@ -13,7 +12,10 @@ public class treeachievePanel : MonoBehaviour
public List<Sprite> sxcardbg;
public List<Sprite> sxcardup;
int prizeNumber=0;
List<GameObject> itemlist = new List<GameObject>();
private async void OnEnable()
{
treeachievementResponse response = await Scene_main_jiekou.instance.Treeachievements();
@ -30,11 +32,32 @@ public class treeachievePanel : MonoBehaviour
if (response.data.top_list[j].expired_time == 0)
{
GameObject obj = Instantiate(sxcardobj, sxcardConnact);
itemlist.Add(obj);
SwitchCardbg(response.data.top_list[j].type,obj);
obj.GetComponent<sxcarditem>().name.text = response.data.top_list[j].name;
}
else
{
{
prizeobj[prizeNumber].gameObject.SetActive(true);
Debug.Log("分红类型"+response.data.top_list[j].type);
switch (response.data.top_list[j].type)
{
case 0:
prizeobj[prizeNumber].GetComponent<treeachievePrize>().reward.sprite = sxcard[12];
Debug.Log("游戏分红卡");
break;
case 1:
prizeobj[prizeNumber].GetComponent<treeachievePrize>().reward.sprite = sxcard[13];
Debug.Log("广告分红卡");
break;
case 2:
prizeobj[prizeNumber].GetComponent<treeachievePrize>().reward.sprite = sxcard[14];
Debug.Log("金币分红卡");
break;
}
prizeobj[prizeNumber].GetComponent<treeachievePrize>().Remainingtime = response.data.top_list[j].expired_time;
prizeobj[prizeNumber].GetComponent<treeachievePrize>().Updatatime();
prizeNumber++;
}
@ -67,8 +90,12 @@ public class treeachievePanel : MonoBehaviour
}
private void OnDisable()
{
prizeNumber = 0;
foreach (GameObject obj in itemlist)
{
Destroy(obj);

View File

@ -0,0 +1,56 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class treeachievePrize : MonoBehaviour
{
public Image reward;
public Text time;
public float Remainingtime;
private float lastCallTime = 0f;
private float interval = 1f; // 每秒调用一次
//float remainingTime = 0f;
void Start()
{
}
public void Updatatime()
{
UpdateCountdownText(Remainingtime);
}
void UpdateCountdownText(float remainingTimes)
{
// 将剩余时间转换为小时、分钟和秒
int hours = Mathf.FloorToInt(remainingTimes / 3600);
int minutes = Mathf.FloorToInt((remainingTimes % 3600) / 60);
int seconds = Mathf.FloorToInt(remainingTimes % 60);
// 使用格式化字符串显示倒计时00:00:00
time.text = string.Format("{0:D2}:{1:D2}:{2:D2}", hours, minutes, seconds);
Debug.Log(time.text);
}
private void Update()
{
if (Time.time - lastCallTime >= interval)
{
// 每秒调用一次的代码
if (Remainingtime > 0)
{
Remainingtime -= 1;
UpdateCountdownText(Remainingtime);
Debug.Log("进入倒计时");
}
// 更新上次调用时间
lastCallTime = Time.time;
}
}
}

View File

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