Compare commits
4 Commits
b5a5871747
...
54adb9bd5a
Author | SHA1 | Date | |
---|---|---|---|
54adb9bd5a | |||
bbd1a38622 | |||
92069e4516 | |||
ea6803f828 |
@ -10078,7 +10078,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 77a35c62d4c7916488d65323cccfdd80, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 63977b6fd70c29d4387087bc3f19c1ed, type: 3}
|
||||||
m_Type: 0
|
m_Type: 0
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
|||||||
Subproject commit fc5f538527b823f30604de978fa6f8ee7396faac
|
Subproject commit cbe42ad621dba92dff20e4fc5704f5d90973acbf
|
@ -6,7 +6,7 @@ TextureImporter:
|
|||||||
serializedVersion: 12
|
serializedVersion: 12
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 1
|
enableMipMap: 0
|
||||||
sRGBTexture: 1
|
sRGBTexture: 1
|
||||||
linearTexture: 0
|
linearTexture: 0
|
||||||
fadeOut: 0
|
fadeOut: 0
|
||||||
@ -36,13 +36,13 @@ TextureImporter:
|
|||||||
filterMode: 1
|
filterMode: 1
|
||||||
aniso: 1
|
aniso: 1
|
||||||
mipBias: 0
|
mipBias: 0
|
||||||
wrapU: 0
|
wrapU: 1
|
||||||
wrapV: 0
|
wrapV: 1
|
||||||
wrapW: 0
|
wrapW: 0
|
||||||
nPOTScale: 1
|
nPOTScale: 0
|
||||||
lightmap: 0
|
lightmap: 0
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
spriteMode: 0
|
spriteMode: 1
|
||||||
spriteExtrude: 1
|
spriteExtrude: 1
|
||||||
spriteMeshType: 1
|
spriteMeshType: 1
|
||||||
alignment: 0
|
alignment: 0
|
||||||
@ -51,9 +51,9 @@ TextureImporter:
|
|||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
alphaUsage: 1
|
alphaUsage: 1
|
||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 1
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 8
|
||||||
textureShape: 1
|
textureShape: 1
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
@ -131,7 +131,7 @@ TextureImporter:
|
|||||||
outline: []
|
outline: []
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID:
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
internalID: 0
|
internalID: 0
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
|
@ -59,6 +59,8 @@ public class WaterPanel : MonoBehaviour
|
|||||||
TreeBg.texture = DaytimeSp;
|
TreeBg.texture = DaytimeSp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
|
@ -24,6 +24,7 @@ public class Lottery : MonoBehaviour
|
|||||||
{
|
{
|
||||||
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();
|
||||||
|
Update_itemClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ public class Lottery : MonoBehaviour
|
|||||||
{
|
{
|
||||||
LotteryBtn.onClick.AddListener(LotteryClick);
|
LotteryBtn.onClick.AddListener(LotteryClick);
|
||||||
ClosefightingBtn.onClick.AddListener(CloseBtnClick);
|
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();
|
PetAdoptResponse response = await Scene_main_jiekou.instance.PetAdopts();
|
||||||
if (response.code == 200)
|
if (response.code == 200)
|
||||||
@ -98,6 +99,11 @@ public class Lottery : MonoBehaviour
|
|||||||
}
|
}
|
||||||
objitem.Clear();
|
objitem.Clear();
|
||||||
fightinglist.Clear();
|
fightinglist.Clear();
|
||||||
|
foreach (GameObject obj in ExuExhibitmusklist)
|
||||||
|
{
|
||||||
|
Destroy(obj);
|
||||||
|
}
|
||||||
|
ExuExhibitmusklist.Clear();
|
||||||
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();
|
||||||
@ -108,12 +114,22 @@ public class Lottery : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Promptmgr.Instance.PromptBubble("Ë®µÎÓà¶î²»×ã");
|
Promptmgr.Instance.PromptBubble("Ë®µÎÓà¶î²»×ã");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
private void OnDisable()
|
||||||
void Update()
|
|
||||||
{
|
{
|
||||||
|
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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ using UnityEngine.UI;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
|
|
||||||
|
|
||||||
public class WebJoinroom : MonoBehaviour
|
public class WebJoinroom : MonoBehaviour
|
||||||
{
|
{
|
||||||
private ClientWebSocket _webSocket;
|
private ClientWebSocket _webSocket;
|
||||||
@ -33,8 +35,11 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
public GameObject shuaigan;
|
public GameObject shuaigan;
|
||||||
public GameObject shougou;
|
public GameObject shougou;
|
||||||
public Animator animator;
|
public Animator animator;
|
||||||
|
public GameObject yupanel;
|
||||||
|
public Image zhanshiyu;
|
||||||
private async void Start()
|
private async void Start()
|
||||||
{
|
{
|
||||||
|
yupanel.SetActive(false);
|
||||||
TimeText.gameObject.transform.parent.gameObject.SetActive(false);
|
TimeText.gameObject.transform.parent.gameObject.SetActive(false);
|
||||||
Debug.Log(PlayerPrefs.GetString("UserToken"));
|
Debug.Log(PlayerPrefs.GetString("UserToken"));
|
||||||
AuthorizationValue = PlayerPrefs.GetString("UserToken");
|
AuthorizationValue = PlayerPrefs.GetString("UserToken");
|
||||||
@ -71,8 +76,8 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
_webSocket = new ClientWebSocket();
|
_webSocket = new ClientWebSocket();
|
||||||
|
|
||||||
// 添加 Authorization 头
|
// 添加 Authorization 头
|
||||||
_webSocket.Options.SetRequestHeader("Authorization", "Bearer "+ AuthorizationValue);
|
_webSocket.Options.SetRequestHeader("Authorization", "Bearer " + AuthorizationValue);
|
||||||
// _webSocket.Options.SetRequestHeader("client-info",);
|
// _webSocket.Options.SetRequestHeader("client-info",);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -119,7 +124,7 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
case "FISHING_INFO":
|
case "FISHING_INFO":
|
||||||
// 解析为 FishJoinroomresponse 类型
|
// 解析为 FishJoinroomresponse 类型
|
||||||
FishJoinroomresponse fishResponse = JsonConvert.DeserializeObject<FishJoinroomresponse>(message);
|
FishJoinroomresponse fishResponse = JsonConvert.DeserializeObject<FishJoinroomresponse>(message);
|
||||||
fishJoinroomData= fishResponse.data;
|
fishJoinroomData = fishResponse.data;
|
||||||
if (fishResponse?.data != null)
|
if (fishResponse?.data != null)
|
||||||
{
|
{
|
||||||
disbalance(fishResponse.data.balance);
|
disbalance(fishResponse.data.balance);
|
||||||
@ -199,7 +204,7 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
fishmove(fishResponse2.data.prize.id);
|
fishmove(fishResponse2.data.prize.id);
|
||||||
foreach (var item in fishJoinroomData.items)
|
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);
|
Promptmgr.Instance.PromptBubble(item.intro);
|
||||||
}
|
}
|
||||||
@ -215,9 +220,9 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,9 +248,9 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
// 更新 Aintime,每次递归时都重新计算
|
// 更新 Aintime,每次递归时都重新计算
|
||||||
var spriteAniation = shougou.GetComponent<SpriteAniation>();
|
var spriteAniation = shougou.GetComponent<SpriteAniation>();
|
||||||
spriteAniation.Aintime = randomDelay * 1000 / spriteAniation.sprites.Count;
|
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\\\"}\" }");
|
await SendJsonMessage("{ \"code\": \"FISHING\", \"content\": \"{\\\"action\\\":\\\"FISHING\\\"}\" }");
|
||||||
@ -340,11 +345,11 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
|
|
||||||
public void disbalance(float detail)
|
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)
|
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 liftHeight = 300f; // 吊起的高度
|
||||||
float liftDuration = 2f; // 吊起动画的持续时间
|
float liftDuration = 2f; // 吊起动画的持续时间
|
||||||
float shakeStrength = 1f; // 摇动的强度
|
float shakeStrength = 1f; // 摇动的强度
|
||||||
float shakeDuration = 0.3f; // 摇动持续时间
|
float shakeDuration = 0.3f; // 摇动持续时间
|
||||||
|
|
||||||
GameObject ob = Instantiate(yu[id]);
|
GameObject ob = Instantiate(yu[id]);
|
||||||
ob.transform.SetParent(transform, false);
|
ob.transform.SetParent(transform, false);
|
||||||
ob.transform.localPosition = new Vector3(-45, 200, 0);
|
ob.transform.localPosition = new Vector3(-45, 200, 0);
|
||||||
Vector3 initialPosition = transform.position;
|
Vector3 initialPosition = transform.position;
|
||||||
ob.transform.DOMoveY(1800, liftDuration)
|
ob.transform.DOMoveY(1500, liftDuration)
|
||||||
.SetEase(Ease.OutSine) // 使用缓动函数让鱼上升更加自然
|
.SetEase(Ease.OutSine) // 使用缓动函数让鱼上升更加自然
|
||||||
.OnComplete(() =>
|
.OnComplete(() =>
|
||||||
{
|
{
|
||||||
@ -378,7 +385,17 @@ public class WebJoinroom : MonoBehaviour
|
|||||||
transform.DOShakePosition(shakeDuration, shakeStrength, 10, 90, false, true)
|
transform.DOShakePosition(shakeDuration, shakeStrength, 10, 90, false, true)
|
||||||
.OnKill(() => Debug.Log("鱼被吊起的动画完成!"));
|
.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);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class treeachievePanel : MonoBehaviour
|
public class treeachievePanel : MonoBehaviour
|
||||||
@ -13,7 +12,10 @@ public class treeachievePanel : MonoBehaviour
|
|||||||
public List<Sprite> sxcardbg;
|
public List<Sprite> sxcardbg;
|
||||||
public List<Sprite> sxcardup;
|
public List<Sprite> sxcardup;
|
||||||
|
|
||||||
|
int prizeNumber = 0;
|
||||||
List<GameObject> itemlist = new List<GameObject>();
|
List<GameObject> itemlist = new List<GameObject>();
|
||||||
|
|
||||||
|
|
||||||
private async void OnEnable()
|
private async void OnEnable()
|
||||||
{
|
{
|
||||||
treeachievementResponse response = await Scene_main_jiekou.instance.Treeachievements();
|
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;
|
obj.GetComponent<sxcarditem>().name.text = response.data.top_list[j].name;
|
||||||
}
|
}
|
||||||
else
|
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)
|
void SwitchCardbg(int type,GameObject obj)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user