Compare commits

...

4 Commits

Author SHA1 Message Date
54adb9bd5a Merge branch 'main' of http://shu.sheziwanglo.cn:3000/shurongsen/Cute_demon_attacks 2025-01-07 20:39:54 +08:00
bbd1a38622 修复覆盖 2025-01-07 20:38:02 +08:00
92069e4516 修改bug 2025-01-07 20:02:26 +08:00
ea6803f828 合并测试 2025-01-07 18:12:37 +08:00
8 changed files with 8641 additions and 4962 deletions

View File

@ -10078,7 +10078,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 77a35c62d4c7916488d65323cccfdd80, type: 3}
m_Sprite: {fileID: 21300000, guid: 63977b6fd70c29d4387087bc3f19c1ed, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit fc5f538527b823f30604de978fa6f8ee7396faac
Subproject commit cbe42ad621dba92dff20e4fc5704f5d90973acbf

View File

@ -6,7 +6,7 @@ TextureImporter:
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
@ -36,13 +36,13 @@ TextureImporter:
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
@ -51,9 +51,9 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
@ -131,7 +131,7 @@ TextureImporter:
outline: []
physicsShape: []
bones: []
spriteID:
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:

View File

@ -59,6 +59,8 @@ public class WaterPanel : MonoBehaviour
TreeBg.texture = DaytimeSp;
}
}
// Start is called before the first frame update

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,7 @@ public class Lottery : MonoBehaviour
{
LotteryBtn.onClick.AddListener(LotteryClick);
ClosefightingBtn.onClick.AddListener(CloseBtnClick);
Update_itemClick();
}
@ -87,7 +88,7 @@ public class Lottery : MonoBehaviour
}
async void LotteryClick()
async void LotteryClick()
{
PetAdoptResponse response = await Scene_main_jiekou.instance.PetAdopts();
if (response.code == 200)
@ -98,6 +99,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,12 +114,22 @@ public class Lottery : MonoBehaviour
{
Promptmgr.Instance.PromptBubble("Ë®µÎÓà¶î²»×ã");
}
}
// Update is called once per frame
void Update()
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
}

View File

@ -10,6 +10,8 @@ using UnityEngine.UI;
using System.Net;
using System.Reflection;
using DG.Tweening;
public class WebJoinroom : MonoBehaviour
{
private ClientWebSocket _webSocket;
@ -33,8 +35,11 @@ public class WebJoinroom : MonoBehaviour
public GameObject shuaigan;
public GameObject shougou;
public Animator animator;
public GameObject yupanel;
public Image zhanshiyu;
private async void Start()
{
yupanel.SetActive(false);
TimeText.gameObject.transform.parent.gameObject.SetActive(false);
Debug.Log(PlayerPrefs.GetString("UserToken"));
AuthorizationValue = PlayerPrefs.GetString("UserToken");
@ -71,8 +76,8 @@ public class WebJoinroom : MonoBehaviour
_webSocket = new ClientWebSocket();
// 添加 Authorization 头
_webSocket.Options.SetRequestHeader("Authorization", "Bearer "+ AuthorizationValue);
// _webSocket.Options.SetRequestHeader("client-info",);
_webSocket.Options.SetRequestHeader("Authorization", "Bearer " + AuthorizationValue);
// _webSocket.Options.SetRequestHeader("client-info",);
try
{
@ -119,7 +124,7 @@ public class WebJoinroom : MonoBehaviour
case "FISHING_INFO":
// 解析为 FishJoinroomresponse 类型
FishJoinroomresponse fishResponse = JsonConvert.DeserializeObject<FishJoinroomresponse>(message);
fishJoinroomData= fishResponse.data;
fishJoinroomData = fishResponse.data;
if (fishResponse?.data != null)
{
disbalance(fishResponse.data.balance);
@ -199,7 +204,7 @@ public class WebJoinroom : MonoBehaviour
fishmove(fishResponse2.data.prize.id);
foreach (var item in fishJoinroomData.items)
{
if(fishResponse2.data.prize.id==item.id)
if (fishResponse2.data.prize.id == item.id)
{
Promptmgr.Instance.PromptBubble(item.intro);
}
@ -215,9 +220,9 @@ public class WebJoinroom : MonoBehaviour
break;
}
}
}
}
}
@ -243,9 +248,9 @@ public class WebJoinroom : MonoBehaviour
// 更新 Aintime每次递归时都重新计算
var spriteAniation = shougou.GetComponent<SpriteAniation>();
spriteAniation.Aintime = randomDelay * 1000 / spriteAniation.sprites.Count;
remainingTime = randomDelay;
//remainingTime = randomDelay;
// 延迟随机时间
await Task.Delay(TimeSpan.FromSeconds(randomDelay)/2);
await Task.Delay(800);
// 延迟结束后发送消息
await SendJsonMessage("{ \"code\": \"FISHING\", \"content\": \"{\\\"action\\\":\\\"FISHING\\\"}\" }");
@ -340,11 +345,11 @@ public class WebJoinroom : MonoBehaviour
public void disbalance(float detail)
{
balance.text=detail.ToString();
balance.text = detail.ToString();
}
public void dissurplus(float detail,int p)
public void dissurplus(float detail, int p)
{
surpluscount_text.text = (p*(int)detail).ToString()+"金币";
surpluscount_text.text = (p * (int)detail).ToString() + "金币";
}
void UpdateCountdownText(float remainingTime)
{
@ -359,18 +364,20 @@ public class WebJoinroom : MonoBehaviour
}
public void fishmove(int id)
public async void fishmove(int id)
{
float liftHeight = 300f; // 吊起的高度
float liftDuration = 2f; // 吊起动画的持续时间
float shakeStrength = 1f; // 摇动的强度
float shakeDuration = 0.3f; // 摇动持续时间
GameObject ob = Instantiate(yu[id]);
ob.transform.SetParent(transform, false);
ob.transform.localPosition = new Vector3(-45, 200, 0);
Vector3 initialPosition = transform.position;
ob.transform.DOMoveY(1800, liftDuration)
ob.transform.DOMoveY(1500, liftDuration)
.SetEase(Ease.OutSine) // 使用缓动函数让鱼上升更加自然
.OnComplete(() =>
{
@ -378,7 +385,17 @@ public class WebJoinroom : MonoBehaviour
transform.DOShakePosition(shakeDuration, shakeStrength, 10, 90, false, true)
.OnKill(() => Debug.Log("鱼被吊起的动画完成!"));
});
Destroy(ob,1.5f);
Destroy(ob, 1f);
await Task.Delay(300);
yupanel.SetActive(true);
zhanshiyu.sprite = yu[id].GetComponent<Image>().sprite;
yupanel.transform.DOScale(1.3f, 1f) // 使用缓动函数让鱼上升更加自然
.OnComplete(() =>
{
yupanel.SetActive(false);
yupanel.transform.DOScale(1f, 1f);
});
}

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();
@ -33,16 +35,37 @@ public class treeachievePanel : MonoBehaviour
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++;
}
}
}
}
void SwitchCardbg(int type,GameObject obj)
{