Compare commits
No commits in common. "6d3ce950b50ff8b959efbf37576841c3c96aed9a" and "74ed20888867fe86301e3f9935347774f7e9b2ff" have entirely different histories.
6d3ce950b5
...
74ed208888
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,6 @@ using System.Collections;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PhotoMovement : MonoBehaviour
|
||||
{
|
||||
@ -21,37 +20,33 @@ public class PhotoMovement : MonoBehaviour
|
||||
public GameObject shuaigan;
|
||||
public GameObject shougan;
|
||||
public bool type=false;
|
||||
public Sprite[] sprites;
|
||||
int count = 0;
|
||||
private void Start()
|
||||
{
|
||||
image.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public async void To1()
|
||||
public void changetype()
|
||||
{
|
||||
if (type == true)
|
||||
while(type)
|
||||
{
|
||||
To1();
|
||||
}
|
||||
}
|
||||
public async void To1()
|
||||
{
|
||||
shuaigan.gameObject.SetActive(true);
|
||||
var time=shuaigan.GetComponent<SpriteAniation>().sprites.Count * shuaigan.GetComponent<SpriteAniation>().Aintime;
|
||||
await Task.Delay((int)time);
|
||||
daiji.gameObject.SetActive(true);
|
||||
shuaigan.gameObject.SetActive(false);
|
||||
//await Task.Delay(1000);
|
||||
await Task.Delay(1000);
|
||||
daiji.gameObject.SetActive(false);
|
||||
shougan.gameObject.SetActive(true);
|
||||
var time1 = shougan.GetComponent<SpriteAniation>().sprites.Count * shougan.GetComponent<SpriteAniation>().Aintime;
|
||||
StartCoroutine(MoveAlongPath());
|
||||
currentPathIndex = 0;
|
||||
image.gameObject.SetActive(true);
|
||||
image.GetComponent<Image>().sprite = sprites[count% sprites.Length];
|
||||
count++;
|
||||
await Task.Delay((int)time1-100);
|
||||
await Task.Delay((int)time1);
|
||||
Del1();
|
||||
|
||||
|
||||
}
|
||||
public void Del1()
|
||||
{
|
||||
@ -88,7 +83,6 @@ public class PhotoMovement : MonoBehaviour
|
||||
}
|
||||
image.gameObject.SetActive(false);
|
||||
shougan.gameObject.SetActive(false);
|
||||
image.transform.localPosition=new Vector3 (467, -144, 0);
|
||||
|
||||
}
|
||||
public void change()
|
||||
@ -97,8 +91,4 @@ public class PhotoMovement : MonoBehaviour
|
||||
currentPathIndex = 0;
|
||||
image.gameObject.SetActive(true);
|
||||
}
|
||||
public void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -38,13 +38,12 @@ public class WebFishingPK : MonoBehaviour
|
||||
private UnityEngine.Color normalColor = UnityEngine.Color.white; // 默认颜色
|
||||
private UnityEngine.Color selectedColor = UnityEngine.Color.blue; // 选中时的颜色
|
||||
|
||||
public Button returnbtn;
|
||||
|
||||
/// <summary>
|
||||
/// 钓鱼
|
||||
/// </summary>
|
||||
///
|
||||
public PhotoMovement photoMovement;
|
||||
public PhotoMovement photoMovement1;
|
||||
private async void Start()
|
||||
{
|
||||
TimeText.gameObject.SetActive(false);
|
||||
@ -71,10 +70,6 @@ public class WebFishingPK : MonoBehaviour
|
||||
{
|
||||
await SendJsonMessage(int.Parse(Dropdown.options[Dropdown.value].text), pos);
|
||||
});
|
||||
returnbtn.onClick.AddListener(async () =>
|
||||
{
|
||||
await SendJsonMessage("{ \"code\": \"FISHING_PK\", \"content\": \"{\\\"action\\\":\\\"LEAVE\\\"}\" }");
|
||||
});
|
||||
|
||||
}
|
||||
private void ChangeButtonColor(Button btn, UnityEngine.Color color)
|
||||
@ -145,24 +140,13 @@ public class WebFishingPK : MonoBehaviour
|
||||
Debug.Log(fishResponse.data.countdown_type);
|
||||
if(fishResponse.data.countdown_type==0)
|
||||
{
|
||||
photoMovement.type = true;
|
||||
photoMovement.Del1();
|
||||
photoMovement.To1();
|
||||
photoMovement1.type = true;
|
||||
photoMovement1.Del1();
|
||||
photoMovement1.To1();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
photoMovement.Del1();
|
||||
photoMovement.type = false;
|
||||
|
||||
photoMovement.To2();
|
||||
photoMovement1.Del1();
|
||||
photoMovement1.type = false;
|
||||
|
||||
photoMovement1.To2();
|
||||
|
||||
}
|
||||
Debug.Log(fishResponse.data.amount_left);
|
||||
@ -201,23 +185,13 @@ public class WebFishingPK : MonoBehaviour
|
||||
Debug.Log(fishResponse2.data.countdown_type);
|
||||
if (fishResponse2.data.countdown_type == 0)
|
||||
{
|
||||
photoMovement.type = true;
|
||||
photoMovement.Del1();
|
||||
photoMovement.To1();
|
||||
photoMovement1.type = true;
|
||||
photoMovement1.Del1();
|
||||
photoMovement1.To1();
|
||||
}
|
||||
else
|
||||
{
|
||||
photoMovement.Del1();
|
||||
photoMovement.type = false;
|
||||
|
||||
photoMovement.To2();
|
||||
photoMovement1.Del1();
|
||||
photoMovement1.type = false;
|
||||
|
||||
photoMovement1.To2();
|
||||
}
|
||||
Debug.Log(fishResponse2.data.amount_left);
|
||||
Debug.Log(fishResponse2.data.amount_right);
|
||||
|
@ -37,7 +37,6 @@ public class WebJoinroom : MonoBehaviour
|
||||
public Animator animator;
|
||||
public GameObject yupanel;
|
||||
public Image zhanshiyu;
|
||||
public Button returnbtn;
|
||||
private async void Start()
|
||||
{
|
||||
yupanel.SetActive(false);
|
||||
@ -46,10 +45,7 @@ public class WebJoinroom : MonoBehaviour
|
||||
AuthorizationValue = PlayerPrefs.GetString("UserToken");
|
||||
|
||||
await ConnectWebSocket();
|
||||
returnbtn.onClick.AddListener(async () =>
|
||||
{
|
||||
await SendJsonMessage("{ \"code\": \"FISHING\", \"content\": \"{\\\"action\\\":\\\"LEAVE\\\"}\" }");
|
||||
});
|
||||
|
||||
Tourubtn.onClick.AddListener(async () =>
|
||||
{
|
||||
await SendJsonMessage(1);
|
||||
|
Loading…
Reference in New Issue
Block a user