骑行界面字体

This commit is contained in:
lishuo committed 2021-04-19 18:03:04 +08:00
1 parent af63072f29
commit 82923fe4f8
13 files changed
+2390 -2188

No files matched your search

+2 -60
View File
@@ -75,31 +75,6 @@ namespace Assets.Scenes.Ride.Scripts
public Vector2d Currentlatlong { get => currentlatlong; }
#endregion
#region 游戏状态控制
//开始骑行
public void SetStart()
{
mainController.isStart = true;
startTime = DateTime.Now;
}
//继续骑行
public void SetContinue()
{
mainController.isStart = true;
}
//暂停骑行
public void SetPause()
{
mainController.isStart = false;
//characterAnimator.SetBool("IsRide", false);
}
//退出或者完成骑行
public void SetQuit()
{
isQuit = true;
endTime.AddSeconds(ticks);//计算结束时间
}
#endregion
void Start()
{
@@ -207,43 +182,14 @@ namespace Assets.Scenes.Ride.Scripts
StopCoroutine("LateUpload");
}
protected string CaptureCamera(Camera camera, Rect rect)
{
// 创建一个RenderTexture对象
RenderTexture rt = new RenderTexture((int)rect.width, (int)rect.height, 0);
// 临时设置相关相机的targetTexture为rt, 并手动渲染相关相机
camera.targetTexture = rt;
camera.Render();
//ps: --- 如果这样加上第二个相机,可以实现只截图某几个指定的相机一起看到的图像。
//ps: camera2.targetTexture = rt;
//ps: camera2.Render();
//ps: -------------------------------------------------------------------
// 激活这个rt, 并从中中读取像素。
RenderTexture.active = rt;
Texture2D screenShot = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.RGB24, false);
screenShot.ReadPixels(rect, 0, 0);// 注:这个时候,它是从RenderTexture.active中读取像素
screenShot.Apply();
// 重置相关参数,以使用camera继续在屏幕上显示
camera.targetTexture = null;
//ps: camera2.targetTexture = null;
RenderTexture.active = null; // JC: added to avoid errors
GameObject.Destroy(rt);
// 最后将这些纹理数据,成一个图片文件
byte[] bytes = screenShot.EncodeToPNG();
string filename = Application.dataPath + "/"+Guid.NewGuid().ToString() +".png";
System.IO.File.WriteAllBytes(filename, bytes);
//Debug.Log(string.Format("截屏了一张照片: {0}", filename));
return filename;
}
public int CurrentIndex;
private int index;
//当前距离所在的海拔/坡度/距离 下一个点的坡度以及剩余距离
void ComputeNextSlope()
{
double sumDistance = 0;
if (mapData == null)
return;
var pointList = mapData.List;
int preIndex = 0;
for (int i = 0; i < pointList.Count; i++)
@@ -265,10 +211,6 @@ namespace Assets.Scenes.Ride.Scripts
nextSlope = pointList[nextIndex].Grade;
nextSlopeDistance = sumDistance - totalDistance * 1000;
currentSlopeDistance = totalDistance * 1000 - (sumDistance - pointList[index].Distance);
////bearing
//var nextpoint = Turf.Point(new double[] { pointList[nextIndex].Point[1], pointList[nextIndex].Point[0] });
//var point = Turf.Point(new double[] { currentlatlong.y, currentlatlong.x });
//bearing = TurfCS.Turf.Bearing(point, nextpoint);
}
//根据距离计算坐标
Vector2d Along(double endDistance)