Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp
This commit is contained in:
commit
0458a23c20
@ -1563,7 +1563,7 @@ GameObject:
|
||||
- component: {fileID: 7021295876441894168}
|
||||
- component: {fileID: 7021295876449305338}
|
||||
m_Layer: 0
|
||||
m_Name: onlinePlayerTest
|
||||
m_Name: onlinePlayerNoScript
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@ -1960,7 +1960,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &7021295876441894184
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -763,7 +763,10 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
player.transform.position = currentPos;
|
||||
playerController.currentPos = currentPos;
|
||||
var trail = FindObjectOfType<TrailRenderer>();
|
||||
trail.enabled = true;
|
||||
if (trail != null)
|
||||
{
|
||||
trail.enabled = true;
|
||||
}
|
||||
|
||||
Vector2d nextLatLon = Along(recorderData.EndDistance + 0.1);
|
||||
//设定人物方向
|
||||
@ -1266,6 +1269,13 @@ public BaseUIManager singleUIManager;
|
||||
index = endDistance >= mapData.TotalDistance ? pointList.Count - 1 : index;
|
||||
return index;
|
||||
}
|
||||
|
||||
public double Distance(Vector2d from, Vector2d to)
|
||||
{
|
||||
var pt1 = Turf.Point(new double[] { from.x, from.y });
|
||||
var pt2 = Turf.Point(new double[] { to.x, to.y });
|
||||
return Turf.Distance(pt1, pt2);
|
||||
}
|
||||
public Vector2d Along(double endDistance)
|
||||
{
|
||||
if (mapData != null)
|
||||
|
||||
@ -163,7 +163,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
//如果观察的是当前用户 隐藏UI 添加trailrender
|
||||
var iscurrentUser = mainController.currentPlayer.UserId == UserId;
|
||||
arrowImage.gameObject.SetActive(!iscurrentUser);
|
||||
var s = mainController.currentPlayer.Currentlatlong;
|
||||
var e = currentlatlong;
|
||||
var distancesss = mainController.Distance(s, e);
|
||||
arrowImage.gameObject.SetActive(!iscurrentUser && distancesss <= 2);
|
||||
|
||||
if (iscurrentUser && trailRenderer == null)
|
||||
{
|
||||
trailRenderer = gameObject.AddComponent<TrailRenderer>();
|
||||
@ -172,8 +176,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var Graph2 = mainController.Get3dGraph2(); //Resources.Load<Material>("UI/Material/3dGraph2");
|
||||
trailRenderer.material = Graph2;//new Material[] { Graph2 };
|
||||
trailRenderer.time = 30;
|
||||
trailRenderer.startWidth = 1f;
|
||||
trailRenderer.endWidth = 1f;
|
||||
trailRenderer.startWidth = 0.5f;
|
||||
trailRenderer.endWidth = 0.5f;
|
||||
trailRenderer.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||
trailRenderer.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||
trailRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user