68 lines
2.0 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();
}
2022-03-10 18:32:53 +08:00
//计算
protected override void ComputePlayer()
{
2022-12-05 18:29:49 +08:00
2022-03-24 09:36:59 +08:00
}
2022-06-02 18:05:41 +08:00
2022-03-24 09:36:59 +08:00
protected override void ComputeAnimator()
{
base.ComputeAnimator();
}
protected override int GetCurrentFrame()
{
2022-12-05 18:29:49 +08:00
return this.currentFrame;
2022-03-10 18:32:53 +08:00
}
protected override void ComputeVideo()
{
2022-03-31 18:40:19 +08:00
base.ComputeVideo();
}
2022-07-06 17:48:55 +08:00
protected override void CreateHeadImage()
{
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>();
}
var f = totalDistance;
preTime = f;
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
}
}
}