Merge branch 'dev_cyp' into dev_ar_cyp

# Conflicts:
#	Assets/Resources/UI/Font/HanWangZonYi.ttf.meta
#	Assets/Resources/UI/language.json
#	Assets/Scenes/Login.unity
#	Assets/Scripts/Apis/Models/MapRoute.cs
#	Assets/Scripts/App.cs
#	Assets/Scripts/ConfigHelper.cs
#	Assets/Scripts/Scenes/Ride/Scripts/PlayerController.cs
#	Assets/Scripts/UIManager.cs
#	Assets/Scripts/Utils/Utils.cs
This commit is contained in:
lishuo committed 2022-06-02 11:30:37 +08:00
commit e513eeac5c
301 files changed
+49814 -11770

No files matched your search

+20 -12
View File
@@ -32,6 +32,7 @@ public class MainController : BaseScene
Loom.Initialize();
msg = transform.Find("GameObject/Message").GetComponent<CanvasGroup>();
InitialMessage();
MailReceiver.Instance().GetMessage();
#if UNITY_ANDROID || UNITY_IOS
transform.GetComponent<CanvasScaler>().referenceResolution = new Vector2(844, 390);
//transform.Find("Panel").GetComponent<RectTransform>().sizeDelta = new Vector2(844, 390);
@@ -308,18 +309,25 @@ public class MainController : BaseScene
//{
// UIManager.ShowHomePanel();
//});
//#if UNITY_ANDROID || UNITY_IOS
// if (!App.IsRowerMode.HasValue)
// {
// UIManager.ShowRowerSelector();
// return;
// }
// if (App.IsRowerMode == true)
// {
// UIManager.ShowRowerPanel();
// return;
// }
//#endif
#if UNITY_ANDROID || UNITY_IOS
#region 划船机功能:隐藏骑行
UIManager.ShowRowerPanel();
return;
#endregion
if (!App.IsRowerMode.HasValue)
{
UIManager.ShowHomePanel();
UIManager.ShowRowerSelector();
return;
}
if (App.IsRowerMode == true)
{
UIManager.ShowHomePanel();
UIManager.ShowRowerPanel();
return;
}
#endif
LastRide();//检查本地异常中断的骑行并弹窗提示继续
if (App.MainSceneParam.ContainsKey("Name") && !string.IsNullOrEmpty(App.MainSceneParam["Name"]))
{
@@ -93,7 +93,7 @@ namespace Assets.Scenes.Ride.Scripts
{
var now = DateTime.Now;
//超过一秒没有收到消息
Console.WriteLine($"Heartbeat_Elapsed{(now - LastActiveTime).TotalSeconds}");
//Console.WriteLine($"Heartbeat_Elapsed{(now - LastActiveTime).TotalSeconds}");
if ((now - LastActiveTime).TotalSeconds > 1)
{
onlineUserHelper.SetOnlineUser(new List<ReceiveMsgModel>());
@@ -119,7 +119,7 @@ namespace Assets.Scenes.Ride.Scripts.Network
protected override void OnDisconnected()
{
//base.OnDisconnected();
Console.WriteLine("tcp断线,3秒后重连");
//Console.WriteLine("tcp断线,3秒后重连");
Thread.Sleep(3000);
if (!_stop)
@@ -825,9 +825,9 @@ public BaseUIManager singleUIManager;
Camera.main.transform.DOLocalMove(neareast, 1f);
//StartCoroutine(MoveCamera(far, near));//初始摄像头
var check = CheckAnt();
//#if UNITY_EDITOR
#if UNITY_EDITOR
check = true;
//#endif
#endif
if (check || isWatch)
{
singleUIManager.StartRide();
@@ -61,9 +61,9 @@ namespace Assets.Scenes.Ride.Scripts
cadance = mainController.UpdateCadence();
weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight;
//#if UNITY_EDITOR
power = 400;
//#endif
#if UNITY_EDITOR
power = 300;
#endif
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
}
catch (Exception ex)
@@ -9,6 +9,10 @@ using DG.Tweening;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using Facebook.Unity;
using System.Web;
using UnityEngine.Networking;
using System.Collections;
using System.Threading.Tasks;
namespace Assets.Scenes.Ride.Scripts
{
@@ -104,11 +108,13 @@ namespace Assets.Scenes.Ride.Scripts
photoURL: new Uri(cyclingController.mapRoute.CoverImage));
}
private void shareToWx(BaseEventData b)
{
private async void shareToWx(BaseEventData b)
{
UIManager.Instance.StartCoroutine(ShowLoading());
var res = await ConfigHelper.mapInterruptRecordApi.GetRecordSnapShot(cyclingController.RankingId);
if (App.weChatController.IsWeChatAppInstalled())
{
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}RoutesRecords/{cyclingController.RankingId}?Token={App.CurrentUser.cookie}", cyclingController.mapRoute.Name, "By " + App.CurrentUser.Nickname,null);
App.weChatController.ShareImageToWX(0, res.data, Resources.Load<Sprite>("Images/pf").texture.EncodeToJPG());
}
else
{
@@ -116,11 +122,18 @@ namespace Assets.Scenes.Ride.Scripts
}
}
private void shareToWxGp(BaseEventData b)
private IEnumerator ShowLoading()
{
Utils.showToast(null, "首次分享图片会消耗一些时间,请耐心等待", type: 1);
yield return null;
}
private async void shareToWxGp(BaseEventData b)
{
UIManager.Instance.StartCoroutine(ShowLoading());
var res = await ConfigHelper.mapInterruptRecordApi.GetRecordSnapShot(cyclingController.RankingId);
if (App.weChatController.IsWeChatAppInstalled())
{
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}RoutesRecords/{cyclingController.RankingId}?Token={App.CurrentUser.cookie}", cyclingController.mapRoute.Name, "By " + App.CurrentUser.Nickname,null);
App.weChatController.ShareImageToWX(1, res.data,Resources.Load<Sprite>("Images/pf").texture.EncodeToJPG());
}
else
{