多人暂存
This commit is contained in:
1 parent
9e2e778e12
commit
dc8f8ceb80
6 files changed
+27
-27
No files matched your search
@@ -77,6 +77,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
WeightKg = item.WeightKg,
|
||||
Sex = item.Sex,
|
||||
FrameRate = item.FrameRate,
|
||||
Speed = item.Speed
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
if (_contactList != null) _contactList.Clear();
|
||||
var list = MapUDPService.GetOnlineUsers(App.RouteIdParam);
|
||||
var currentPlayer = list.Where(c => c.IsSelf).FirstOrDefault();
|
||||
list = list.Where(c => c.Id != App.CurrentUser.Id).ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
@@ -71,7 +72,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
var currenList = GetComponentsInChildren<ListItem>(true);
|
||||
var list = MapUDPService.GetOnlineUsers(App.RouteIdParam,manager.cyclingController.recorderData.RoomId);//最新列表
|
||||
var currentPlayerInfo = list.Where(c => c.Id.ToString() == manager.CurrentPlayer.UserId.ToString()).FirstOrDefault();
|
||||
list = list.Where(c => c.Id != App.CurrentUser.Id).ToList();
|
||||
list = list.Where(c => c.Id != App.CurrentUser.Id).OrderByDescending(c=>c.EndDistance).ToList();
|
||||
if (currenList.Count() == 0 && list.Count() > 0)
|
||||
{
|
||||
InitData();
|
||||
@@ -80,9 +81,10 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
_recyclableScrollRect.ReloadData();
|
||||
}
|
||||
}
|
||||
|
||||
var currentPlayer = FindObjectOfType<VideoPlayer>();
|
||||
|
||||
|
||||
var currentPlayer = manager.CurrentPlayer;
|
||||
if (currentPlayer == null)
|
||||
return;
|
||||
foreach (ListItem o in currenList)
|
||||
{
|
||||
if (currentPlayer.UserId.ToString() == o.Id)
|
||||
@@ -93,6 +95,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
var left = Math.Round((needUpdate.EndDistance - currentPlayerInfo.EndDistance) * 1000);
|
||||
o.UpdateItem(needUpdate.Name, left.ToString() + "M", needUpdate.Id.ToString());
|
||||
o.gameObject.SetActive(true);
|
||||
o.transform.SetSiblingIndex((int)left);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Assets.Scenes.Ride.Scripts;
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Assets.Scripts.UI.Prefab.Device;
|
||||
using GeoJSON.Net.Geometry;
|
||||
@@ -10,19 +9,13 @@ using RenderHeads.Media.AVProVideo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TurfCS;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Events;
|
||||
using Helper = Assets.Scenes.Ride.Scripts.Helper;
|
||||
using System.Collections;
|
||||
using FluffyUnderware.Curvy.Examples;
|
||||
using FluffyUnderware.Curvy.Controllers;
|
||||
using FluffyUnderware.Curvy;
|
||||
using System.Reflection;
|
||||
using Assets.AR;
|
||||
using Assets.Core;
|
||||
|
||||
@@ -41,7 +34,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
public RouteResult routeResult;
|
||||
public string recordId { get; set; }
|
||||
public DateTime startTime { get; set; }
|
||||
public CyclingModel cyclingModel;
|
||||
public CyclingModel cyclingModel { get; set; }
|
||||
public BaseCycling cyclingController { get; set; }
|
||||
private double endDistance { get; set; }
|
||||
GameObject infoPanel;
|
||||
@@ -324,8 +317,8 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
//设置骑行模式
|
||||
public void SetCyclingModel(CyclingModel mode)
|
||||
{
|
||||
startTime = UIManager.Now.GetDateTime();
|
||||
Debug.Log("SetCyclingModel" + selectParamModel.ContinueMark);
|
||||
//startTime = UIManager.Now.GetDateTime();
|
||||
Debug.Log("SetCyclingModel" + mode.ToString());
|
||||
this.cyclingModel = mode;
|
||||
switch (cyclingModel)
|
||||
{
|
||||
@@ -340,13 +333,18 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
//开始游戏
|
||||
public void StartGame()
|
||||
{
|
||||
if (startTime == null)
|
||||
//if (startTime != DateTime.MinValue)
|
||||
{
|
||||
startTime = UIManager.Now.GetDateTime();
|
||||
}
|
||||
isStart = true;
|
||||
}
|
||||
//骑行是否开始
|
||||
public bool IsReady()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//骑行是否开始
|
||||
public bool IsStart()
|
||||
{
|
||||
return isStart;
|
||||
|
||||
@@ -263,8 +263,8 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
};
|
||||
UIManager.ShowGameRoomCountDownPanel(seconds,()=> {
|
||||
manager.StartGame();
|
||||
manager.SetCyclingModel(Assets.Scenes.Ride.Scripts.Model.CyclingModel.Single);
|
||||
manager.SetCurrentMode(VideoGameManager.ARMode.RIDE);
|
||||
//manager.SetCyclingModel(CyclingModel.GameRoom);
|
||||
//manager.SetCurrentMode(VideoGameManager.ARMode.RIDE);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
recorderData.PreDistance = Math.Round(preDistance, 6, MidpointRounding.AwayFromZero);
|
||||
recorderData.EndDistance = Math.Round(targetData._Distance, 6, MidpointRounding.AwayFromZero);
|
||||
recorderData.RiderDatas.Add(targetData);
|
||||
Debug.Log(recorderData.RoomId);
|
||||
//默认启用多圈
|
||||
if (isSingle && totalDistance >= mapData.TotalDistance)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user