AR继续骑和断线重连继续骑
This commit is contained in:
1 parent
ae58f4d461
commit
9e2e778e12
34 files changed
+3828
-497977
No files matched your search
@@ -50,7 +50,7 @@ class GameRoomDownloadTask : MonoBehaviour
|
||||
public void UpdateProcess(float process)
|
||||
{
|
||||
slider.value = process;
|
||||
if (process >= 100)
|
||||
if (process >= 1)
|
||||
{
|
||||
done.SetActive(true);
|
||||
doneTxt.SetActive(true);
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.AR;
|
||||
using Assets.Scenes.Ride.Scripts;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler
|
||||
public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler,IProgress<float>
|
||||
{
|
||||
public class PropNames
|
||||
{
|
||||
@@ -39,15 +45,11 @@ public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnter
|
||||
listController = FindObjectOfType<GameRoomListController>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
float? localY = null;
|
||||
MapRoute map;
|
||||
Dictionary<string, Texture> caches;
|
||||
private MapRouteAreaItem area = null;
|
||||
Slider slider;
|
||||
public void Initial(MapRoute myMap, Dictionary<string, Texture> caches, MapRouteAreaItem area = null)
|
||||
{
|
||||
if (caches != null)
|
||||
@@ -64,7 +66,7 @@ public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnter
|
||||
var downloadBtn = transform.Find("DownLoadModal/DownLoad").gameObject;
|
||||
var downloading = transform.Find("DownLoadModal/Downloading").gameObject;
|
||||
var downloadTxt = transform.Find("DownLoadModal/Text").gameObject;
|
||||
var slider = transform.Find("DownLoadModal/Slider").GetComponent<Slider>();
|
||||
slider = transform.Find("DownLoadModal/Slider").GetComponent<Slider>();
|
||||
|
||||
var fileName = map.FileName;
|
||||
var path = PFConstants.VideoFolder;
|
||||
@@ -76,49 +78,10 @@ public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnter
|
||||
downloading.SetActive(true);
|
||||
downloadTxt.SetActive(false);
|
||||
slider.gameObject.SetActive(true);
|
||||
Loom.Current.StartCoroutine(Utils.DownloadFileWithProcess(map.FileName, map.Url, path,(p, req) =>
|
||||
{
|
||||
if (gameObject != null)
|
||||
slider.value = p;
|
||||
if (Loom.DownLoadTaskList.ContainsKey(map.FileName))
|
||||
{
|
||||
Loom.DownLoadTaskList[map.FileName] = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
Loom.DownLoadTaskList.Add(map.FileName, p);
|
||||
}
|
||||
}
|
||||
, (p) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(p))
|
||||
{
|
||||
var process = 100f;
|
||||
if (Loom.DownLoadTaskList.ContainsKey(map.FileName))
|
||||
{
|
||||
Loom.DownLoadTaskList[map.FileName] = process;
|
||||
}
|
||||
else
|
||||
{
|
||||
Loom.DownLoadTaskList.Add(map.FileName, process);
|
||||
}
|
||||
if (gameObject != null)
|
||||
{
|
||||
slider.value = process;
|
||||
Ride();
|
||||
transform.Find("DownLoadModal").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gameObject != null)
|
||||
Utils.showToast(gameObject, p);
|
||||
}
|
||||
}));
|
||||
Loom.Download(map);
|
||||
});
|
||||
|
||||
transform.Find("Name").GetComponent<Text>().text = myMap.Name;
|
||||
|
||||
transform.Find("IdContainer/Text").GetComponent<Text>().text = $"#{myMap.Id}";
|
||||
transform.Find("TimesContainer").gameObject.SetActive(myMap.MineCount > 0);
|
||||
transform.Find("TimesContainer/Text").GetComponent<Text>().text = myMap.MineCountString;
|
||||
@@ -340,4 +303,24 @@ public class GameRoomMapItem : MonoBehaviour, IPointerExitHandler, IPointerEnter
|
||||
{
|
||||
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
|
||||
}
|
||||
|
||||
public void Report(float value)
|
||||
{
|
||||
if (gameObject != null)
|
||||
slider.value = value;
|
||||
if (Loom.DownLoadTaskList.ContainsKey(map.FileName))
|
||||
{
|
||||
Loom.DownLoadTaskList[map.FileName] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Loom.DownLoadTaskList.Add(map.FileName, value);
|
||||
}
|
||||
|
||||
if (value == 100)
|
||||
{
|
||||
Ride();
|
||||
transform.Find("DownLoadModal").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -908,7 +908,7 @@ public class GameRoomListController : PFUIPanel
|
||||
private async void GetList()
|
||||
{
|
||||
if (isEnd) return;
|
||||
var res = await ConfigHelper.mapApi.GetList(pageIndex, pageSize, ftname, distance, string.Join(",", hands), is3d, sort, sortDire, isEnableAR:false, isEnableBattle: true);
|
||||
var res = await ConfigHelper.mapApi.GetList(pageIndex, pageSize, ftname, distance, string.Join(",", hands), is3d, sort, sortDire, isEnableAR: isEnableAR, isEnableBattle: true);
|
||||
if (res.result)
|
||||
{
|
||||
if (res.data.Count == 0)
|
||||
|
||||
Reference in new issue
Block a user