人物动画调整&网页url移除#号&riding time 差一秒的问题

This commit is contained in:
lishuo 2021-08-11 10:30:23 +08:00
parent c717b93169
commit 3fcc6c0489
5 changed files with 36 additions and 32 deletions

View File

@ -1227,7 +1227,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -831, y: 621} m_AnchoredPosition: {x: -847.5, y: 621}
m_SizeDelta: {x: 84, y: 28} m_SizeDelta: {x: 84, y: 28}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6673787635055784084 --- !u!222 &6673787635055784084
@ -6135,7 +6135,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0} m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -835, y: 644} m_AnchoredPosition: {x: -851.5, y: 644}
m_SizeDelta: {x: 61, y: 17} m_SizeDelta: {x: 61, y: 17}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &927843223585017441 --- !u!222 &927843223585017441

View File

@ -1,6 +1,7 @@
using Assets.Scripts; using Assets.Scripts;
using Assets.Scripts.Apis; using Assets.Scripts.Apis;
using Assets.Scripts.Apis.Models; using Assets.Scripts.Apis.Models;
using DG.Tweening;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@ -189,16 +190,17 @@ namespace Assets.Scenes.Ride.Scripts
{ {
Utils.DisplayImage(SponsorLogoImage, competition.SponsorCoverage, true); Utils.DisplayImage(SponsorLogoImage, competition.SponsorCoverage, true);
} }
//赛事详情 //赛事简介
//if (!string.IsNullOrEmpty(competition.ShortPreview)) if (!string.IsNullOrEmpty(competition.ShortPreview))
//{ {
// LeftBack.SetActive(false); LeftBack.SetActive(false);
// MiddleBack.SetActive(false); MiddleBack.SetActive(false);
// Utils.DisplayImage(CompetitionDesc, competition.ShortPreview, true); Utils.DisplayImage(CompetitionDesc, competition.ShortPreview, true);
// var canvasGroup = CompetitionDesc.GetComponent<CanvasGroup>(); var canvasGroup = CompetitionDesc.GetComponent<CanvasGroup>();
// canvasGroup.DOFade(1, 1); canvasGroup.DOFade(1, 1);
//} AddProcess(10);
//else }
else
{ {
//异步请求mapbox画出当前路书路线图 //异步请求mapbox画出当前路书路线图
DrawMapRouteAsync(route.Id, 1); DrawMapRouteAsync(route.Id, 1);
@ -234,7 +236,7 @@ namespace Assets.Scenes.Ride.Scripts
//查看赛事详情 //查看赛事详情
protected void ReadCompetitionPreview(BaseEventData baseEvent) protected void ReadCompetitionPreview(BaseEventData baseEvent)
{ {
Application.OpenURL(App.CurrentUser.WebHost + $"/Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}"); Application.OpenURL(App.CurrentUser.WebHost + $"Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}");
} }
protected override void StartRide(BaseEventData baseEvent) protected override void StartRide(BaseEventData baseEvent)
{ {
@ -262,7 +264,7 @@ namespace Assets.Scenes.Ride.Scripts
} }
protected void GoDetail(BaseEventData baseEvent) protected void GoDetail(BaseEventData baseEvent)
{ {
Application.OpenURL(App.CurrentUser.WebHost + $"/Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}"); Application.OpenURL(App.CurrentUser.WebHost + $"Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}");
} }
private void UpdateCompetition() private void UpdateCompetition()

View File

@ -50,7 +50,7 @@ namespace Assets.Scenes.Ride.Scripts
protected double power; protected double power;
protected double elevation; protected double elevation;
protected double cadance; protected double cadance;
protected int heartRate; protected int? heartRate { get; set; }
public int ticks; public int ticks;
protected double totalDistance; protected double totalDistance;
protected double currentSlope; protected double currentSlope;
@ -66,7 +66,7 @@ namespace Assets.Scenes.Ride.Scripts
public double Speed { get => speed; } public double Speed { get => speed; }
public double Power { get => power; } public double Power { get => power; }
public double Cadance { get => cadance; } public double Cadance { get => cadance; }
public double HeartRate { get => heartRate; } public int? HeartRate { get => heartRate; }
public int TotalTicks { get => ticks; } public int TotalTicks { get => ticks; }
public double TotalDistance { get => totalDistance; } public double TotalDistance { get => totalDistance; }
public double Distance { get => distance; } public double Distance { get => distance; }
@ -93,7 +93,7 @@ namespace Assets.Scenes.Ride.Scripts
//StartCoroutine("TestExcute"); //StartCoroutine("TestExcute");
} }
void Update() void FixedUpdate()
{ {
Excute(); Excute();
AfterExcute(); AfterExcute();
@ -164,14 +164,14 @@ namespace Assets.Scenes.Ride.Scripts
characterAnimator.SetFloat("Slope", (float)currentSlope); characterAnimator.SetFloat("Slope", (float)currentSlope);
if (currentSlope > 5) if (currentSlope > 5)
{ {
characterAnimator.speed = 0.5f; characterAnimator.speed = 0.2f;
} }
else else
{ {
characterAnimator.speed = 1f; characterAnimator.speed = 0.45f;
} }
if (totalDistance >= mapData.TotalDistance) if (totalDistance >= mapData.TotalDistance)
{ {
characterAnimator.SetBool("ReachEnd", true);//到达终点 characterAnimator.SetBool("ReachEnd", true);//到达终点
} }
@ -180,8 +180,10 @@ namespace Assets.Scenes.Ride.Scripts
//开始骑行 //开始骑行
if (GetStart()) if (GetStart())
{ {
if (!stopRecord)
ticks++; {
ticks++;
}
Compute();//接受蓝牙设备数据计算 Compute();//接受蓝牙设备数据计算
//计算累计爬升 //计算累计爬升
if (CurrentIndex > 0) if (CurrentIndex > 0)
@ -196,7 +198,7 @@ namespace Assets.Scenes.Ride.Scripts
} }
} }
} }
if (totalDistance > mapData.TotalDistance) if (totalDistance >= mapData.TotalDistance)
{ {
distance = totalDistance - mapData.TotalDistance; distance = totalDistance - mapData.TotalDistance;
totalDistance = mapData.TotalDistance; totalDistance = mapData.TotalDistance;

View File

@ -50,20 +50,20 @@ namespace Assets.Scenes.Ride.Scripts
//speed = mainController.UpDateSpeed(); //speed = mainController.UpDateSpeed();
try try
{ {
heartRate = mainController.UpDateHeart() ?? 0; heartRate = mainController.UpDateHeart();
power = mainController.UpdatePower(); power = mainController.UpdatePower();
cadance = mainController.UpdateCadence(); cadance = mainController.UpdateCadence();
weight = App.CurrentUser.Weight; weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight; bicycleWeight = App.CurrentUser.BicycleWeight;
#if UNITY_EDITOR //#if UNITY_EDITOR
power = 50; power = 500;
#endif //#endif
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100); mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
} }
catch (Exception ex) catch (Exception ex)
{ {
Debug.Log(ex.Message); Debug.Log(ex.Message);
heartRate = 0; //heartRate = 0;
power = 0; power = 0;
cadance = 0; cadance = 0;
} }
@ -116,7 +116,7 @@ namespace Assets.Scenes.Ride.Scripts
recorderData.EndDistance = Math.Round(targetData._Distance,6,MidpointRounding.AwayFromZero); recorderData.EndDistance = Math.Round(targetData._Distance,6,MidpointRounding.AwayFromZero);
recorderData.RiderDatas.Add(targetData); recorderData.RiderDatas.Add(targetData);
//实时计算MaxAp //实时计算MaxAp
mainController.ComputeMaxAP(Power, ticks); //mainController.ComputeMaxAP(Power, ticks);
} }
} }

View File

@ -64,7 +64,7 @@ public class UserInfoController : PFUIPanel
var createBtn = summaryPanel.Find("CreateBtn").gameObject; var createBtn = summaryPanel.Find("CreateBtn").gameObject;
UIManager.AddEvent(createBtn, EventTriggerType.PointerClick, (b) => UIManager.AddEvent(createBtn, EventTriggerType.PointerClick, (b) =>
{ {
Application.OpenURL(App.CurrentUser.WebHost + "/Mine/EditMatch?Token=" + App.CurrentUser.cookie); Application.OpenURL(App.CurrentUser.WebHost + "Mine/EditMatch?Token=" + App.CurrentUser.cookie);
}); });
} }