Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
This commit is contained in:
commit
fa0d9e973c
15 files changed
+779
-694
No files matched your search
@@ -16,9 +16,9 @@ namespace Assets.Scripts.Apis
|
||||
{
|
||||
return Get($"Map/GetMapToken?name={name}");
|
||||
}
|
||||
public string GetTipsList()
|
||||
public JsonResult<List<string>> GetTipsList()
|
||||
{
|
||||
return Get($"Map/GetTipList");
|
||||
return Get<JsonResult<List<string>>>($"Map/GetTipList");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -216,6 +216,11 @@ namespace Assets.Scripts.Apis
|
||||
var result = await GetAsync<JsonResult<List<MapRouteAreaItem>>>($"MapRouteArea/GetRecommendAreaList");
|
||||
return result;
|
||||
}
|
||||
public async Task<JsonResult<List<Recommand>>> GetRecommendList(int pageIndex=0, int pageSize=10000)
|
||||
{
|
||||
var result = await GetAsync<JsonResult<List<Recommand>>>($"Recommand/GetList?pageIndex={pageIndex}&pageSize={pageSize}");
|
||||
return result;
|
||||
}
|
||||
public async Task<JsonResult<List<MapRouteAreaItem>>> GetMemberMapRouteAreaList(int pageIndex, int pageSize)
|
||||
{
|
||||
var result = await GetAsync<JsonResult<List<MapRouteAreaItem>>>($"MapRouteArea/GetMemberMapRouteAreaList?pageIndex={pageIndex}&pageSize={pageSize}");
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Apis.Models
|
||||
{
|
||||
public class Recommand
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int RouteId { get; set; }
|
||||
public int AreaId { get; set; }
|
||||
public int CompetitionId { get; set; }
|
||||
/// <summary>
|
||||
/// Type:0线路 1集合 2活动
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// banner
|
||||
/// </summary>
|
||||
public string CoverImage { get; set; }
|
||||
/// <summary>
|
||||
/// 活动链接
|
||||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 027803d92c272e6449a187b23727986c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -347,6 +347,9 @@ public class MainController : BaseScene
|
||||
if (App.MainSceneParam["Name"] == "UserInfoPanel")
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
UIManager.ShowResultListPanel();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (App.MainSceneParam["Name"] == "RaceHomePanel")
|
||||
@@ -411,10 +414,15 @@ public class MainController : BaseScene
|
||||
var lang = App.GetLocalLanguage();
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item.Point != null && item.Point.Length > 0 && item.Point[0] == -1d)
|
||||
{
|
||||
var message = lang == "zh" ? $"{item.Name}进入了 运动地球" : "entered PowerFun";
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.Id}{item.LastActiveTime}{item.Point}");
|
||||
}
|
||||
if (item.RouteId > 0)
|
||||
{
|
||||
var message = "";
|
||||
if (item.TotalTicks == 0)
|
||||
if (item.TotalTicks == 0 && item.PreDistance == 0)
|
||||
{
|
||||
message = lang=="zh"?$"发起了对<color=#f93086>{item.RouteName}</color>的挑战!" : $"started riding <color=#f93086>{item.RouteName}</color>!";
|
||||
}
|
||||
@@ -427,11 +435,6 @@ public class MainController : BaseScene
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name,item.RouteName), $"{item.RouteId}{item.Name}");
|
||||
}
|
||||
}
|
||||
if (item.Point!=null && item.Point.Length>0 && item.Point[0] == -1d)
|
||||
{
|
||||
var message = lang == "zh" ? $"{item.Name}进入了 运动地球" : "entered PowerFun";
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.Id}{item.LastActiveTime}{item.Point}");
|
||||
}
|
||||
//距离50
|
||||
if (item.EndDistance >= 50)
|
||||
{
|
||||
@@ -444,12 +447,12 @@ public class MainController : BaseScene
|
||||
var message = lang == "zh" ? $"骑行里程达到<color=#e3d427>{"100KM"}</color>!" : $"riding distance reaches <color=#e3d427>{"100KM"}</color>!";
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}100KM");
|
||||
}
|
||||
//速度35
|
||||
if (item.Speed >= 35)
|
||||
{
|
||||
var message = lang == "zh" ? $"骑行速度达到<color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!";
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}35KM/H");
|
||||
}
|
||||
////速度35
|
||||
//if (item.Speed >= 35)
|
||||
//{
|
||||
// var message = lang == "zh" ? $"骑行速度突破<color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!";
|
||||
// EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}35KM/H");
|
||||
//}
|
||||
//速度50
|
||||
if (item.Speed >= 50)
|
||||
{
|
||||
@@ -457,7 +460,7 @@ public class MainController : BaseScene
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}50KM/H");
|
||||
}
|
||||
//功体比
|
||||
if (item.WeightKg >= 3)
|
||||
if (item.WeightKg >= 4)
|
||||
{
|
||||
var message = lang == "zh" ? $"骑行功体比达到<color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!" : $" riding PWR reaches <color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!";
|
||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}3WeightKg");
|
||||
|
||||
@@ -151,19 +151,23 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
characterAnimator.SetFloat("Speed", (float)speed);
|
||||
characterAnimator.SetFloat("Slope", (float)currentSlope);
|
||||
if (currentSlope > 5)
|
||||
{
|
||||
characterAnimator.speed = 0.2f;
|
||||
}
|
||||
else
|
||||
if (currentSlope > 6)
|
||||
{
|
||||
characterAnimator.speed = 0.45f;
|
||||
}
|
||||
|
||||
if (totalDistance >= mapData.TotalDistance)
|
||||
{
|
||||
characterAnimator.SetBool("ReachEnd", true);//到达终点
|
||||
else
|
||||
{
|
||||
characterAnimator.speed = 0.65f;
|
||||
}
|
||||
if (speed > 40)
|
||||
{
|
||||
characterAnimator.speed = 0.75f;
|
||||
}
|
||||
|
||||
//if (totalDistance >= mapData.TotalDistance)
|
||||
//{
|
||||
// characterAnimator.SetBool("ReachEnd", true);//到达终点
|
||||
//}
|
||||
}
|
||||
Compute();//接受蓝牙设备数据计算
|
||||
//开始骑行
|
||||
|
||||
@@ -274,7 +274,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
RotateLock = false;
|
||||
DOTween.Kill(target);
|
||||
target.transform.Rotate(new Vector3(0, 1, 0), r.deltaRotation);
|
||||
target.transform.Rotate(new Vector3(0, -1, 0), r.deltaRotation);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -141,15 +141,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var list = mapApi.GetRouteRanking(route.Id, "1", 0, 10000, "");
|
||||
if (list.result)
|
||||
{
|
||||
if (list.data.list.Count > RankingPageSize)
|
||||
{
|
||||
var ViewAll = panel.transform.Find("ViewAll").gameObject;
|
||||
ViewAll.SetActive(true);
|
||||
UIManager.AddEvent(ViewAll, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
Application.OpenURL($"{App.CurrentUser.WebHost}Routes/{cyclingController.mapRoute.Id}?Token={App.CurrentUser.cookie}");
|
||||
});
|
||||
}
|
||||
//if (list.data.list.Count > RankingPageSize)
|
||||
//{
|
||||
// var ViewAll = panel.transform.Find("ViewAll").gameObject;
|
||||
// ViewAll.SetActive(true);
|
||||
// UIManager.AddEvent(ViewAll, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
// {
|
||||
// Application.OpenURL($"{App.CurrentUser.WebHost}Routes/{cyclingController.mapRoute.Id}?Token={App.CurrentUser.cookie}");
|
||||
// });
|
||||
//}
|
||||
CreateRankingList(list.data.list);
|
||||
AddProcess(10);
|
||||
}
|
||||
@@ -162,6 +162,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
var prefab = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/RankingItem");
|
||||
var myprefab = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/MySelfRankingItem");
|
||||
var viewAllbtn = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/ViewAll");
|
||||
#else
|
||||
var prefab = Resources.Load<GameObject>("UI/Prefab/Ride/RankingItem");
|
||||
var myprefab = Resources.Load<GameObject>("UI/Prefab/Ride/MySelfRankingItem");
|
||||
@@ -186,17 +187,35 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
//如果有自己的记录显示自己的排名
|
||||
var myself = list.Where(c => c.MySelf).FirstOrDefault();
|
||||
if (myself != null)
|
||||
GameObject myselfObj = (GameObject)Instantiate(myprefab, parent);
|
||||
var myselfItemScript = myselfObj.GetComponent<RankingItemScript>();
|
||||
if (myself == null)
|
||||
{
|
||||
GameObject newObj = (GameObject)Instantiate(myprefab, parent);
|
||||
var selectPlayerItemScript = newObj.GetComponent<RankingItemScript>();
|
||||
selectPlayerItemScript.SetRanking(myself.RowNumber.ToString());
|
||||
selectPlayerItemScript.SetName(myself.NickName);
|
||||
selectPlayerItemScript.SetTimer(myself.IsDNF ? "DNF" : myself.TotalTime);
|
||||
selectPlayerItemScript.SetHead(myself.WxHeadImg);
|
||||
myselfItemScript.SetRanking("??");
|
||||
myselfItemScript.SetName(App.CurrentUser.Nickname);
|
||||
myselfItemScript.SetTimer("??:??:??");
|
||||
myselfItemScript.SetHead(App.CurrentUser.WxHeadImg);
|
||||
var texture = cyclingController.GetCountryImageByCode(App.CurrentUser.Country);
|
||||
myselfItemScript.SetCountry(texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
myselfItemScript.SetRanking(myself.RowNumber.ToString());
|
||||
myselfItemScript.SetName(myself.NickName);
|
||||
myselfItemScript.SetTimer(myself.IsDNF ? "DNF" : myself.TotalTime);
|
||||
myselfItemScript.SetHead(myself.WxHeadImg);
|
||||
var texture = cyclingController.GetCountryImageByCode(myself.CountryCode);
|
||||
selectPlayerItemScript.SetCountry(texture);
|
||||
myselfItemScript.SetCountry(texture);
|
||||
}
|
||||
}
|
||||
//显示查询全部按钮
|
||||
if (list.Count > 0)
|
||||
{
|
||||
GameObject ViewAll = (GameObject)Instantiate(viewAllbtn, parent);
|
||||
UIManager.AddEvent(ViewAll, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
Application.OpenURL($"{App.CurrentUser.WebHost}Routes/{cyclingController.mapRoute.Id}?Token={App.CurrentUser.cookie}");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
#if UNITY_EDITOR
|
||||
power = 1443;
|
||||
power = 330;
|
||||
#endif
|
||||
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
|
||||
}
|
||||
@@ -117,8 +117,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//实时计算MaxAp
|
||||
//mainController.ComputeMaxAP(Power, ticks);
|
||||
//实时保存骑行记录
|
||||
|
||||
mainController.SaveRealTime();
|
||||
if (ticks / 60 == 0)
|
||||
{
|
||||
mainController.SaveRealTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void BeforeRun()
|
||||
|
||||
@@ -133,8 +133,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
public void SetDataSource(RecorderDataModel record)
|
||||
{
|
||||
var route = record.CurrentRoute.RouteInstance;
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
//绑定路书信息
|
||||
date.text = record.StartTime.ToShortDateString();
|
||||
date.text = record.StartTime.ToString("yyyy-MM-dd");
|
||||
#else
|
||||
date.text = record.StartTime.ToShortDateString("yyyy-MM-dd");
|
||||
#endif
|
||||
time.text = record.StartTime.ToShortTimeString();
|
||||
level.text = route.Hard;
|
||||
mapName.text = route.Name;
|
||||
|
||||
@@ -11,17 +11,17 @@ public class MultiTips:PFUIText
|
||||
private Button button;
|
||||
private string[] tips { get; set; }
|
||||
private int currentIndex = 0;
|
||||
|
||||
private System.Random random;
|
||||
new void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
text = GetComponent<Text>();
|
||||
var tiplist = ConfigHelper.mapApi.GetTipsList();
|
||||
if (!string.IsNullOrEmpty(tiplist))
|
||||
var result = ConfigHelper.mapApi.GetTipsList();
|
||||
if (result.result)
|
||||
{
|
||||
tips = tiplist.Split('#');
|
||||
tips = result.data.ToArray();
|
||||
}
|
||||
var random = new System.Random();
|
||||
random = new System.Random();
|
||||
currentIndex = random.Next(0, tips.Length);
|
||||
SetText();
|
||||
}
|
||||
@@ -32,24 +32,17 @@ public class MultiTips:PFUIText
|
||||
}
|
||||
public void SetText()
|
||||
{
|
||||
if(text == null)
|
||||
if(text == null || tips.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
currentIndex = random.Next(0, tips.Length);
|
||||
if (currentIndex <= tips.Length)
|
||||
{
|
||||
text.text = tips[currentIndex];
|
||||
if (currentIndex + 1 < tips.Length)
|
||||
{
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
float time = 5f;
|
||||
float time = 10f;
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
@@ -57,7 +50,7 @@ public class MultiTips:PFUIText
|
||||
while (time<0)
|
||||
{
|
||||
SetText();
|
||||
time += 5f;
|
||||
time += 10f;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user