41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using PolyAndCode.UI;
|
|
using System;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Assets.Scripts.Scenes.VideoRide
|
|
{
|
|
public class StickyListItem : MonoBehaviour, ICell
|
|
{
|
|
//UI
|
|
public Text nameLabel;
|
|
public Text distanceLabel;
|
|
public GameObject master;
|
|
//Model
|
|
private ContactInfo _contactInfo;
|
|
private int _cellIndex;
|
|
public string Id;
|
|
public string Rank;
|
|
public string Name;
|
|
private VideoPlayer videoPlayer { get; set; }
|
|
private float timer = 1f;
|
|
private void Update()
|
|
{
|
|
timer -= Time.deltaTime;
|
|
while (timer < 0)
|
|
{
|
|
videoPlayer = FindObjectOfType<VideoPlayer>();
|
|
if (videoPlayer != null)
|
|
{
|
|
nameLabel.text = videoPlayer.UserName;
|
|
distanceLabel.text = "0M";///videoPlayer.totalDistance.ToString("f1");
|
|
Id = videoPlayer.UserId.ToString();
|
|
}
|
|
timer += 1f;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|