70 lines
2.0 KiB
C#
70 lines
2.0 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Assets.Scripts.Scenes.VideoRide
|
|
{
|
|
public class OnlineVideoPlayer : AbstractVideoPlayer
|
|
{
|
|
public double diff;
|
|
public int frames;
|
|
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
}
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
}
|
|
|
|
//计算
|
|
protected override void ComputePlayer()
|
|
{
|
|
|
|
}
|
|
|
|
private Dictionary<int, float> ydic = new Dictionary<int, float>();
|
|
private int currentFrame { get; set; }
|
|
protected override void ComputeAnimator()
|
|
{
|
|
base.ComputeAnimator();
|
|
}
|
|
protected override int GetCurrentFrame()
|
|
{
|
|
return this.currentFrame;
|
|
}
|
|
protected override void ComputeVideo()
|
|
{
|
|
base.ComputeVideo();
|
|
}
|
|
protected override void CreateHeadImage()
|
|
{
|
|
base.CreateHeadImage();
|
|
if (diff < 0)
|
|
((RectTransform)head.transform).anchoredPosition = new Vector2(((RectTransform)head.transform).anchoredPosition.x, -800f);
|
|
}
|
|
|
|
private double preTime;
|
|
//设置当前玩家属性
|
|
public void SetPlayer(string name, double distance, double totalDistance, double cadance,double heartRate, double wkg, int userId,double power,double currentPlayerDistance,int frame)
|
|
{
|
|
if (manager == null)
|
|
{
|
|
manager = FindObjectOfType<VideoGameManager>();
|
|
}
|
|
var f = totalDistance;
|
|
preTime = f;
|
|
this.wkg = wkg;
|
|
this.userName = name;
|
|
this.cadance = cadance;
|
|
this.totalDistance = totalDistance;
|
|
this.heartRate = (int?)heartRate;
|
|
this.userId = userId;
|
|
this.power = power;
|
|
this.speed = distance * 3600;
|
|
this.diff = totalDistance - currentPlayerDistance;
|
|
this.currentFrame = frame;
|
|
}
|
|
}
|
|
}
|