4.14修改,设备连接去掉ftms骑行台

This commit is contained in:
Caiyanpeng committed 2022-04-14 19:18:44 +08:00
1 parent 29e7219c21
commit f383c54507
18 files changed
+2511 -10695

No files matched your search

@@ -1,4 +1,5 @@
using System.Collections;
using Assets.Scripts;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
@@ -16,6 +17,17 @@ public class RowerDevicePanel : PFUIPanel
void Start()
{
}
public override void Show()
{
base.Show();
print("开启扫描");
#if UNITY_ANDROID || UNITY_IOS
App.MainDeviceAdapter.StartScan();
#if UNITY_ANDROID
Utils.CallAndroidMethod("OpenLocationService");
#endif
#endif
}
float timer = 1f;
// Update is called once per frame
@@ -172,11 +172,11 @@ public class RowerMultiModeScript : MonoBehaviour
public int sumdiff { get; set; }
}
public Dictionary<int, RankDiff> rankDiffDict;
public async void GetShadowList(RowerTaskPanel.RowerType rowerType)
public async void GetShadowList(RowerTaskPanel.RowerType rowerType, RowerResultModel reRowData)
{
this.rowerType = rowerType;
currentSecond = -1;
var res = await ConfigHelper.rowerApi.GetShadowList(rowerType);
var res = reRowData ==null? await ConfigHelper.rowerApi.GetShadowList(rowerType): await ConfigHelper.rowerApi.GetReRowShadowList(reRowData.Id);
shadowList = res.data;
//foreach (var t in traceList)
//{
@@ -304,7 +304,7 @@ public class RowerMultiModeScript : MonoBehaviour
var width = t.Find("Main").GetComponent<RectTransform>().sizeDelta.x - t.Find("Main/Boat").GetComponent<RectTransform>().sizeDelta.x;
var diffWidth = data.currentDistance - mineData.currentDistance + 50;
if (data.currentDistance <= 50)
if (data.currentDistance <= 50 && mineData.currentDistance <= 50)
{
diffWidth = data.currentDistance;
}
@@ -335,22 +335,31 @@ public class RowerMultiModeScript : MonoBehaviour
{
var ani = DOTween.Sequence();
var _d = data.list[currentSecond];
if (currentSecond > 0)
if (currentSecond > 0 && _d.Pace > 0)
{
var _pred = data.list[currentSecond - 1];
if (_pred.StrokeCount != _d.StrokeCount)
var spDict = GetComponent<RowerHomeScript>().spriteDict;
int spDictIndex = 0;
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f));
ani.AppendCallback(() =>
{
//上次划桨次数和这次不一样 说明需要划桨一次
var spDict = GetComponent<RowerHomeScript>().spriteDict;
int spDictIndex = 0;
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f));
ani.AppendCallback(() =>
{
int spDictIndex2 = 14;
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f);
});
ani.Play();
}
int spDictIndex2 = 14;
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f);
});
ani.Play();
//var _pred = data.list[currentSecond - 1];
//if (_pred.StrokeCount != _d.StrokeCount)
//{
// //上次划桨次数和这次不一样 说明需要划桨一次
// var spDict = GetComponent<RowerHomeScript>().spriteDict;
// int spDictIndex = 0;
// ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f));
// ani.AppendCallback(() =>
// {
// int spDictIndex2 = 14;
// DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f);
// });
// ani.Play();
//}
}
}
}
@@ -432,7 +441,17 @@ public class RowerMultiModeScript : MonoBehaviour
if (diff.diff != 0)
{
sq.Join(t.parent.DOLocalMoveY(-47 * (diff.rank - 1) - 21.5f, 0.9f).SetEase(Ease.OutBounce));
//if (diff.diff > 0)
//{
// t.parent.SetAsLastSibling();
//}
sq.Join(t.parent.DOLocalMoveY(-47 * (diff.rank - 1) - 21.5f, 0.9f));
var sq1 = DOTween.Sequence();
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(0.2f, 0.45f));
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(1f, 0.45f));
//sq1.SetEase(Ease.InOutCubic);
sq.Join(sq1);
sq.SetEase(Ease.InOutCubic);
//sq.Append(t.GetComponent)
}
t.parent.name = i.ToString();
@@ -701,12 +720,12 @@ public class RowerMultiModeScript : MonoBehaviour
{
game.transform.Find("Content/Rank").GetComponent<Text>().text = item.currentRank.ToString("00");
game.transform.Find("Content/NickName").GetComponent<Text>().text = item.NickName;
Utils.DisplayImageTempDict(game.transform.Find("Content/Avatar").GetComponent<RawImage>(), item.Avatar, caches);
var _c = countryList.FirstOrDefault(x => item.Country == x.country);
if (_c != null)
{
game.transform.Find("Content/Country").GetComponent<Image>().sprite = Resources.Load<Sprite>(_c.source);
}
//Utils.DisplayImageTempDict(game.transform.Find("Content/Avatar").GetComponent<RawImage>(), item.Avatar, caches);
//var _c = countryList.FirstOrDefault(x => item.Country == x.country);
//if (_c != null)
//{
// game.transform.Find("Content/Country").GetComponent<Image>().sprite = Resources.Load<Sprite>(_c.source);
//}
int _d = 0, _p = 0;
if (currentSecond < 0 || item.list.Count == 0)
{
@@ -955,6 +974,7 @@ public class RowerMultiModeScript : MonoBehaviour
void Update()
{
#if UNITY_EDITOR
//return;
timer -= Time.deltaTime;
if (timer < 0)
{