增加选择页,修改记录列表pc兼容

This commit is contained in:
Caiyanpeng committed 2021-09-28 15:25:52 +08:00
1 parent 8802676b98
commit 85e0a13f08
18 files changed
+2121 -1426

No files matched your search

+7 -4
View File
@@ -32,8 +32,8 @@ public static class App
public static double longitude { get; internal set; }
public static bool FromLogin => false;
private static bool _IsRowerMode = false;
public static bool IsRowerMode
public static bool? _IsRowerMode = null;
public static bool? IsRowerMode
{
get => _IsRowerMode;
set
@@ -106,8 +106,11 @@ public static class App
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
#endif
Debug.Log(PlayerPrefs.GetString("IsRowerMode"));
App._IsRowerMode = bool.Parse(PlayerPrefs.GetString("IsRowerMode"));
var isRower = PlayerPrefs.GetString("IsRowerMode");
if (!string.IsNullOrEmpty(isRower))
{
App._IsRowerMode = bool.Parse(isRower);
}
Screen.sleepTimeout = SleepTimeout.NeverSleep;
//Debug.Log(TimeSpan.FromSeconds(1).ToString(@"mm\:ss"));
}
@@ -137,7 +137,7 @@ namespace Assets.Scripts.Ble
Debug.Log($"設備信息,{item.IdGuid},{string.Join(";",item.IdByteArray)}" );
if (item.IdByteArray == ServiceUuids.Ftms)
{
if (App.IsRowerMode)
if (App.IsRowerMode == true)
{
sensor = SensorType.Rower;
}
-1
View File
@@ -121,7 +121,6 @@ public class LoginController : BaseScene
loadingPanel = transform.Find("LoadingPanel").gameObject;
#endif
#if UNITY_ANDROID
Debug.Log(Permission.HasUserAuthorizedPermission(Permission.ExternalStorageRead));
Permission.RequestUserPermission(Permission.FineLocation);
Permission.RequestUserPermission(Permission.ExternalStorageRead);
Permission.RequestUserPermission(Permission.ExternalStorageWrite);
+6 -1
View File
@@ -62,7 +62,12 @@ public class MainController : BaseScene
//{
// UIManager.ShowHomePanel();
//});
if (App.IsRowerMode)
if (!App.IsRowerMode.HasValue)
{
UIManager.ShowRowerSelector();
return;
}
if (App.IsRowerMode == true)
{
UIManager.ShowRowerPanel();
return;
+5 -1
View File
@@ -51,12 +51,16 @@ public class MainNav : MonoBehaviour
});
}
public void HideDevice()
public void ShowRowerTab()
{
if (transform.Find("Device"))
{
transform.Find("Device").gameObject.SetActive(false);
}
if (transform.Find("Exit"))
{
transform.Find("Exit").gameObject.SetActive(true);
}
}
// Start is called before the first frame update
@@ -89,9 +89,9 @@ public class RowerHomeScript : PFUIPanel
};
GetComponent<RectTransform>().localScale = Vector3.one;
GetComponent<RectTransform>().localPosition = Vector3.zero;
var mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
mainNav.ShowExit();
mainNav.HideDevice();
//mainNav.ShowExit();
var btnHome = transform.Find("Other/BtnHome").gameObject;
UIManager.AddEvent(btnHome, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => ReturnHome());
btnStart = transform.Find("Other1/BtnStart").gameObject;
@@ -105,6 +105,9 @@ public class RowerHomeScript : PFUIPanel
public override void Show()
{
base.Show();
var mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
mainNav.ShowRowerTab();
transform.MyDOFade();
Init();
//transform.Find("Left/Rower").GetComponent<RowerAnimation>().StartAnimation();
}
@@ -53,7 +53,10 @@ public class ResultListController : PFUIPanel
matchScroll = scrollContent.Find("MatchList");
matchContent = matchScroll.Find("Viewport").Find("Content");
rowerScroll = scrollContent.Find("RowerList");
rowerContent = rowerScroll.Find("Viewport").Find("Content");
if (rowerScroll)
{
rowerContent = rowerScroll.Find("Viewport").Find("Content");
}
contents = new Transform[] { routeContent, matchContent, rowerContent};
if (btnRoute != null)
@@ -112,7 +115,9 @@ public class ResultListController : PFUIPanel
scrolls = new Transform[] { routeScroll, matchScroll, rowerScroll };
//GetList(0);
GetList(1);
#if UNITY_ANDROID || UNITY_IOS
GetList(2);
#endif
}
public void Load()
@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RowerSelector : PFUIPanel
{
// Start is called before the first frame update
void Start()
{
var btnRide = transform.Find("Container/BtnRide").gameObject;
if (btnRide)
{
UIManager.AddEvent(btnRide, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
Close();
UIManager.ShowHomePanel();
});
}
var btnRower = transform.Find("Container/BtnRower").gameObject;
if (btnRower)
{
UIManager.AddEvent(btnRower, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
Close();
UIManager.ShowRowerPanel();
});
}
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 062e7f4cad92a34488b81254ede4cbe9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+15
View File
@@ -257,6 +257,19 @@ public class UIManager : MonoBehaviour
UIManager.Instance.RowerResult.Initial(id);
}
}
private RowerSelector mRowerSelector;
public RowerSelector RowerSelector
{
get
{
return this.GetPanelInstance("RowerSelector", ref this.mRowerSelector);
}
}
public static void ShowRowerSelector()
{
Debug.Log("进入Rower");
UIManager.Show(UIManager.Instance.RowerSelector, null, true);
}
/*划船机页面*/
#region 比赛点击弹窗
private RaceModalScript mRaceModalScript;
@@ -324,6 +337,8 @@ public class UIManager : MonoBehaviour
InitNow();
}
EventQueueSystem.AddListener<CompetitonStartMessageEvent>(CompetitonStartHandler);
}
//比赛即将开始消息提醒