显示当前路线在线的人
This commit is contained in:
1 parent
6645310601
commit
8ca32cd1ae
13 files changed
+311
-375
No files matched your search
@@ -0,0 +1,60 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using Assets.Scripts;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class OnlinePlayerController : AbstractPlayer
|
||||
{
|
||||
public PlayerController _playerController;
|
||||
RawImage head;
|
||||
GameObject headPanel;
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
base.Init();
|
||||
_playerController = FindObjectOfType<PlayerController>();
|
||||
}
|
||||
|
||||
protected override void Compute()
|
||||
{
|
||||
currentlatlong = mainController.Along(totalDistance);//下一个坐标
|
||||
}
|
||||
|
||||
public void SetDistance(double _distance)
|
||||
{
|
||||
distance = _distance;
|
||||
}
|
||||
|
||||
public void SetTotalDistance(double _totalDistance)
|
||||
{
|
||||
totalDistance = _totalDistance;
|
||||
}
|
||||
private string headUrl;
|
||||
public void SetHead(string url )
|
||||
{
|
||||
headUrl = url;
|
||||
}
|
||||
public void MoveHead(Transform parent,Vector3 nextPosition)
|
||||
{
|
||||
if (headPanel == null)
|
||||
{
|
||||
headPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/HeadPanel"));
|
||||
headPanel.transform.parent = parent;
|
||||
headPanel.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
|
||||
}
|
||||
if (head == null)
|
||||
{
|
||||
head = headPanel.GetComponentInChildren<RawImage>();
|
||||
if (!string.IsNullOrEmpty(headUrl))
|
||||
{
|
||||
Utils.DisplayImage(head, headUrl, true);
|
||||
}
|
||||
}
|
||||
headPanel.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user