登录增加loading&赛事提醒修改
This commit is contained in:
1 parent
51cea743be
commit
dfb80658dd
23 files changed
+2137
-34355
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Assets.Scripts.Scenes;
|
||||
using Assets.Scripts.UI.Control;
|
||||
using Assets.Scripts.UI.Prefab.Login;
|
||||
using DG.Tweening;
|
||||
@@ -17,6 +18,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Android;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -56,8 +58,10 @@ public class SignForm
|
||||
public Dropdown countrys { get; set; }
|
||||
public Dropdown units { get; set; }
|
||||
}
|
||||
public class LoginController : MonoBehaviour
|
||||
public class LoginController : BaseScene
|
||||
{
|
||||
public GameObject loadingPanel { get; set; }
|
||||
|
||||
private Transform mainContent;
|
||||
/*初始页面*/
|
||||
private Transform quickContainer;
|
||||
@@ -113,6 +117,16 @@ public class LoginController : MonoBehaviour
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
loadingPanel = transform.Find("LoadingPanel").gameObject;
|
||||
#endif
|
||||
#if UNITY_ANDROID
|
||||
if (!Permission.HasUserAuthorizedPermission(Permission.FineLocation))
|
||||
Permission.RequestUserPermission(Permission.FineLocation);
|
||||
|
||||
if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageRead))
|
||||
Permission.RequestUserPermission(Permission.ExternalStorageRead);
|
||||
#endif
|
||||
Init();
|
||||
if (loginScrollView != null)
|
||||
{
|
||||
@@ -1114,6 +1128,9 @@ public class LoginController : MonoBehaviour
|
||||
/// <param name="gou"></param>
|
||||
void goMain(Transform gou)
|
||||
{
|
||||
#if (UNITY_ANDROID || UNITY_IOS)
|
||||
StartCoroutine("Loading");
|
||||
#endif
|
||||
var data = userResult;
|
||||
if (data == null) return;
|
||||
//ConfigHelper.CurrentUser = res.data;
|
||||
@@ -1135,8 +1152,30 @@ public class LoginController : MonoBehaviour
|
||||
App.CurrentUser = data;
|
||||
App.RideSetting.Sensitivity = data.Sensitivity;
|
||||
//查询我参加的比赛
|
||||
UIManager.UpdateJoinCompetition();
|
||||
SceneManager.LoadSceneAsync("MainScene");
|
||||
Task.Run(() =>
|
||||
{
|
||||
UIManager.UpdateJoinCompetition();
|
||||
});
|
||||
//SceneManager.LoadSceneAsync("MainScene");
|
||||
StartCoroutine("LoadMain");
|
||||
}
|
||||
|
||||
private IEnumerator Loading()
|
||||
{
|
||||
yield return null;
|
||||
DontDestroyOnLoad(loadingPanel);
|
||||
Utils.showLoadingExtension(loadingPanel);
|
||||
}
|
||||
|
||||
private IEnumerator LoadMain()
|
||||
{
|
||||
yield return new WaitForSeconds(1f);
|
||||
SceneManager.LoadSceneAsync("MainScene").completed += QuickLoginUser_completed;
|
||||
}
|
||||
|
||||
private void QuickLoginUser_completed(AsyncOperation obj)
|
||||
{
|
||||
//Utils.hideLoadingExtension(loadingPanel);
|
||||
}
|
||||
/// <summary>
|
||||
/// 缓存打钩的用户信息
|
||||
|
||||
Reference in new issue
Block a user