57 lines
1.7 KiB
C#
Raw Normal View History

2022-12-05 18:29:49 +08:00
using System.Collections.Generic;
2022-03-24 09:36:59 +08:00
using UnityEngine;
2022-03-10 18:32:53 +08:00
namespace Assets.Scripts.Scenes.VideoRide
{
public class OnlineVideoPlayer : AbstractVideoPlayer
{
2022-08-17 18:28:28 +08:00
2022-12-05 18:29:49 +08:00
protected override void Start()
2022-08-17 18:28:28 +08:00
{
base.Start();
}
2022-03-24 09:36:59 +08:00
protected override void Update()
{
base.Update();
}
public override void ComputeAnimator()
2022-03-24 09:36:59 +08:00
{
base.ComputeAnimator();
}
public override void ComputeAnimatorSpeed()
{
base.ComputeAnimatorSpeed();
}
public override void CreateHeadImage()
2022-07-06 17:48:55 +08:00
{
base.CreateHeadImage();
2022-12-08 19:17:34 +08:00
if (Diff < 0)
2022-07-06 17:48:55 +08:00
((RectTransform)head.transform).anchoredPosition = new Vector2(((RectTransform)head.transform).anchoredPosition.x, -800f);
}
2022-12-08 19:17:34 +08:00
public override void SetPlayer(string name, double speed, double preDistance, double endDistance, double cadance, double heartRate, double wkg, int userId, double power, double currentPlayerDistance, int frame)
2022-03-10 18:32:53 +08:00
{
2022-10-08 13:26:38 +08:00
if (manager == null)
{
manager = FindObjectOfType<VideoGameManager>();
}
this.wkg = wkg;
2022-12-05 18:29:49 +08:00
this.userName = name;
2022-03-24 09:36:59 +08:00
this.cadance = cadance;
2022-12-08 19:17:34 +08:00
this.totalDistance = endDistance;
2022-03-24 09:36:59 +08:00
this.heartRate = (int?)heartRate;
2022-12-05 18:29:49 +08:00
this.userId = userId;
this.power = power;
2022-12-08 19:17:34 +08:00
this.speed = speed;
this.Speed = speed/3.6;
this.Diff = endDistance - currentPlayerDistance;
this.currentFrame = frame;
2022-12-08 19:17:34 +08:00
this.PreDistance = preDistance * 1000;
this.EndDistance = endDistance * 1000;
this.OnlineSpeed = speed / 3.6;
2022-03-10 18:32:53 +08:00
}
}
}