4.13修改细节,位移动画前暂存

This commit is contained in:
CaiYanPeng 2022-04-13 15:44:02 +08:00
parent 874dec5ec6
commit d44638354d
6 changed files with 2438 additions and 2219 deletions

File diff suppressed because it is too large Load Diff

View File

@ -336,12 +336,12 @@
"COUNT": "桨次",
"Count": "桨次",
"EST": "预计完成",
"Stroke to start the workout.": "拉动划船机开始训练!",
"Stroke to start the workout.": "请拉动手柄开始训练!",
"Unconnected": "未连接",
"Connected": "已连接",
"STOPPED": "已停止",
"Do you need to save?": "你需要保存吗?",
"Stroke to continue the workout.": "拉动划船机继续训练!",
"Stroke to continue the workout.": "请拉动手柄继续训练!",
"Just Row": "自由划",
"GO": "开始",
"Speed/500m": "500m配速",

View File

@ -189,7 +189,7 @@ public class RowerHomeScript : PFUIPanel
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
var c1 = new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_create_44"), () =>
{
//UIManager.ShowRowerWelldone("3026214f-e6e0-4297-8668-f7177dbaebe4");
//UIManager.ShowRowerWelldone("33171855-66FC-4121-935C-0F4DA98E5BB2");
//return;
if (checkRowing()) return;
if (C2RowerData.IsEnabled == true && C2RowerData.rowerType != null) return;

View File

@ -142,7 +142,7 @@ public class RowerMultiModeScript : MonoBehaviour
}
userList[i].currentRank = rank;
}
print(string.Join(",", rankDiffDict.Select(x => x.Value.diff)));
print(string.Join(",", rankDiffDict.OrderBy(x=>x.Value.rank).Select(x => x.Value.diff)));
}
private List<TraceData> HandleData()
{
@ -244,6 +244,7 @@ public class RowerMultiModeScript : MonoBehaviour
var _d = data.list[data.list.Count - 1];
t.Find("Left/Time").GetComponent<Text>().text = TimeSpan.FromSeconds(_d.Pace).ToString(@"mm\:ss");
}
t.Find("Mine").gameObject.SetActive(data.isMine);
var diff = data.currentDistance - mineData.currentDistance;
if (diff > 0)
{
@ -422,7 +423,8 @@ public class RowerMultiModeScript : MonoBehaviour
if (currentSecond % 2 == 1)
{
allsq.Append(listc.DOLocalMoveY(47 * sindex + 115.5f, 0.5f).SetEase(Ease.InBounce));
//0-0.5
allsq.Append(listc.DOLocalMoveY(47 * sindex + 115.5f, 0.5f));
var indexRange = getStartRangeByMineData();
var sq = DOTween.Sequence();
@ -436,28 +438,38 @@ public class RowerMultiModeScript : MonoBehaviour
//需要做动画
if (data.UserId != traceList[i].userId)
{
var mysq = DOTween.Sequence();
if (traceList[i].userId == App.CurrentUser.Id)
//var mysq = DOTween.Sequence();
//if (traceList[i].userId == App.CurrentUser.Id)
//{
// mysq.Join(t.GetComponent<CanvasGroup>().DOFade(0, 0.5f).SetEase(Ease.OutSine));
//}
//if (data.UserId != App.CurrentUser.Id)
//{
// sq1.Append(t.GetComponent<CanvasGroup>().DOFade(0.68f, 0.45f).SetEase(Ease.InSine));
// sq1.AppendCallback(() =>
// {
// DisplayTrace(t.Find("p1"), data, mineData);
// });
// sq1.Append(t.GetComponent<CanvasGroup>().DOFade(1, 0.45f));
//}
//else
//{
// mysq.Join(t.GetComponent<RowerTraceAnimated>().startAnimation(0.5f, () =>
// {
// DisplayTrace(t.Find("p2"), data, mineData);
// }, rankDiffDict[data.UserId].sumdiff >= 0 ? 1 : 0));
// allsq.Append(mysq);
//}
sq1.Append(t.GetComponent<RowerTraceAnimated>().startAnimation(0.8f, () =>
{
mysq.Join(t.GetComponent<CanvasGroup>().DOFade(0, 0.5f).SetEase(Ease.OutSine));
}
if (data.UserId != App.CurrentUser.Id)
{
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(0.68f, 0.45f).SetEase(Ease.InSine));
sq1.AppendCallback(() =>
{
DisplayTrace(t.Find("p1"), data, mineData);
});
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(1, 0.45f));
}
else
{
mysq.Join(t.GetComponent<RowerTraceAnimated>().startAnimation(0.5f, () =>
{
DisplayTrace(t.Find("p2"), data, mineData);
}, rankDiffDict[data.UserId].sumdiff >= 0 ? 1 : 0));
allsq.Append(mysq);
}
DisplayTrace(t.Find("p2"), data, mineData);
}, rankDiffDict[data.UserId].sumdiff >= 0 ? 1 : 0).SetEase(Ease.OutBounce));
//sq1.Append(t.GetComponent<RowerTraceAnimated>().startAnimation(0.8f, () =>
//{
// DisplayTrace(t.Find("p2"), data, mineData);
//}, 0).SetEase(Ease.OutBounce));
}
else
{

View File

@ -2,6 +2,8 @@
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.UI;
using Assets.Scripts;
//using ZenFulcrum.EmbeddedBrowser;
public class RowerTraceAnimated : MonoBehaviour
@ -44,10 +46,12 @@ public class RowerTraceAnimated : MonoBehaviour
{
c2.localPosition = v3.Value + new Vector3(0, dirOffset, 0);
c2.localRotation = Quaternion.Euler(new Vector3(type == 1 ? 270 : 90, 0, 0));
c2.GetComponent<Image>().color = Utils.HexToColorHtml("#353543FF");
callback();
//print(c.localPosition.ToString() + c.Find("p1").localPosition.ToString() + c.Find("p2").localPosition.ToString());
});
var sq1 = DOTween.Sequence();
sq1.Join(c2.GetComponent<Image>().DOFade(0, time));
sq1.Join(c.DORotate(new Vector3(type == 1 ? 90 : -90, 0, 0), time));
sq1.Join(c.DOLocalMoveY(v1.Value.y + (type == 0 ? -offset : offset), time));
sq1.Join(c.DOLocalMoveZ(v1.Value.z + offset, time));

View File

@ -67,6 +67,11 @@ public class RowerWelldone : PFUIPanel
// Update is called once per frame
void Update()
{
if (Input.touchCount > 0)
{
startTime = false;
transform.Find("Container/BtnDefine/Text").GetComponent<Text>().text = $"{App.GetLocalString("DEFINE")}";
}
if (startTime)
{
timer -= Time.deltaTime;
@ -99,7 +104,7 @@ public class RowerWelldone : PFUIPanel
this.data = res.data;
DisplayData(res.data, caches);
startTime = true;
remainTime = 10f;
remainTime = 30f;
timer = 1f;
transform.Find("Container/BtnDefine/Text").GetComponent<Text>().text = $"{App.GetLocalString("DEFINE")}({remainTime.ToString("#0")})";
}