AR骑行beta
This commit is contained in:
1 parent
4d5bc8f080
commit
9b1bb3d9ba
45 files changed
+35055
-2401
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Assets.Scenes.Ride.Scripts;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -6,6 +7,7 @@ using UnityEngine.UI;
|
||||
public class GameRoomCountDownController : PFUIPanel
|
||||
{
|
||||
public Text count;
|
||||
public Text endCount;
|
||||
|
||||
private int Seconds { get; set; }
|
||||
public GameRoomModel GameRoom { get; set; }
|
||||
@@ -22,10 +24,11 @@ public class GameRoomCountDownController : PFUIPanel
|
||||
base.Show();
|
||||
}
|
||||
|
||||
public void Init(int seconds,Action action)
|
||||
public void Init(int seconds,Action action,bool isEnd = false)
|
||||
{
|
||||
Seconds = seconds;
|
||||
Callback = action;
|
||||
endCount.gameObject.SetActive(isEnd);
|
||||
}
|
||||
|
||||
float timer = 0f;
|
||||
@@ -44,7 +47,8 @@ public class GameRoomCountDownController : PFUIPanel
|
||||
}
|
||||
else
|
||||
{
|
||||
count.text = Seconds.ToString();
|
||||
count.text = Helper.FormatTicks(Seconds);
|
||||
endCount.text = Helper.FormatTicks(Seconds);
|
||||
}
|
||||
Seconds--;
|
||||
timer += 1f;
|
||||
|
||||
@@ -12,6 +12,7 @@ using Assets.Scenes.Ride.Scripts.Model;
|
||||
|
||||
public class GameRoomDetailController : PFUIPanel
|
||||
{
|
||||
public Text versionText;
|
||||
public RawImage Avatar;
|
||||
public Text idText;
|
||||
public Text roomName;
|
||||
@@ -128,6 +129,7 @@ public class GameRoomDetailController : PFUIPanel
|
||||
private void Init()
|
||||
{
|
||||
App.Model = "GameRoom";
|
||||
versionText.text = "V"+App.AppVersion.ToString();
|
||||
MapUDPService.MessageListener = ListenerHandler;
|
||||
GameRoom = App.gameRoomDetail;
|
||||
|
||||
@@ -250,9 +252,6 @@ public class GameRoomDetailController : PFUIPanel
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
App.Model = "";
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,7 @@ public class GameRoomListController : PFUIPanel
|
||||
private GameObject btn40;
|
||||
private GameObject btn50;
|
||||
private GameObject btn60;
|
||||
private GameObject btnMore;
|
||||
|
||||
private GameObject btn2;
|
||||
private GameObject btn3;
|
||||
@@ -172,12 +173,12 @@ public class GameRoomListController : PFUIPanel
|
||||
Total = roomList.GameRoomTotal;
|
||||
ListChanged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
list = null;
|
||||
Total = 0;
|
||||
ListChanged = true;
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// list = null;
|
||||
// Total = 0;
|
||||
// ListChanged = true;
|
||||
//}
|
||||
//查询自己当前创建的房间信息并进入
|
||||
var info = message.Where(c => c.RoomList != null && c.RoomList.Where(o => o.UserId == App.CurrentUser.Id && o.Status == 0).Any()).FirstOrDefault();
|
||||
if (info != null)
|
||||
@@ -210,20 +211,6 @@ public class GameRoomListController : PFUIPanel
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
|
||||
//LOOM中取数据渲染下载当前下载进度
|
||||
var downLoadList = transform.Find("DownLoadList").gameObject;
|
||||
var downloadPanel = transform.Find("DownloadPanel").gameObject;
|
||||
if (!downLoadList.activeSelf && !downloadPanel.activeSelf)
|
||||
{
|
||||
var content = downLoadList.transform.Find("Viewport/Content");
|
||||
foreach (var item in Loom.DownLoadTaskList)
|
||||
{
|
||||
var newtask = Instantiate(_downLoadTask, content);
|
||||
newtask.GetComponent<GameRoomDownloadTask>().Init(0, item.Key, downloadPanel);
|
||||
downLoadList.SetActive(true);
|
||||
}
|
||||
}
|
||||
App.Model = "GameRoom";
|
||||
MapUDPService.MessageListener = ListenerHandler;
|
||||
MapUDPService.SendQueryGameRoomList(App.CurrentUser.Id, pageHelper.PageIndex, pageHelper.PageSize, seachName);
|
||||
@@ -275,6 +262,20 @@ public class GameRoomListController : PFUIPanel
|
||||
CreateClicked = false;
|
||||
UIManager.ShowGameRoomDetailPanel();
|
||||
}
|
||||
|
||||
//LOOM中取数据渲染下载当前下载进度
|
||||
var downLoadList = transform.Find("DownLoadList").gameObject;
|
||||
var downloadPanel = transform.Find("DownloadPanel").gameObject;
|
||||
if (!downLoadList.activeSelf && !downloadPanel.activeSelf)
|
||||
{
|
||||
var content = downLoadList.transform.Find("Viewport/Content");
|
||||
foreach (var item in Loom.DownLoadTaskList)
|
||||
{
|
||||
var newtask = Instantiate(_downLoadTask, content);
|
||||
newtask.GetComponent<GameRoomDownloadTask>().Init(0, item.Key, downloadPanel);
|
||||
downLoadList.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitStep1()
|
||||
@@ -290,7 +291,14 @@ public class GameRoomListController : PFUIPanel
|
||||
UIManager.RemoveEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag);
|
||||
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
}
|
||||
|
||||
var close = transform.Find("MapList/Modal/Close").gameObject;
|
||||
if (close != null)
|
||||
{
|
||||
UIManager.RemoveEvent(close, UnityEngine.EventSystems.EventTriggerType.PointerClick);
|
||||
UIManager.AddEvent(close, UnityEngine.EventSystems.EventTriggerType.PointerClick, (e)=> {
|
||||
mapList.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
distanceOptions = topContainer.Find("distanceOptions");
|
||||
if (distanceOptions != null)
|
||||
{
|
||||
@@ -320,12 +328,12 @@ public class GameRoomListController : PFUIPanel
|
||||
Refresh();
|
||||
});
|
||||
}
|
||||
//是否收藏
|
||||
//是否AR
|
||||
if (favContainer != null)
|
||||
{
|
||||
isEnableAR = true;//默认勾选ar
|
||||
var g = favContainer.Find("Gou").gameObject;
|
||||
g.SetActive(false);
|
||||
isEnableAR = false;
|
||||
g.SetActive(isEnableAR);
|
||||
UIManager.RemoveEvent(favContainer.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick);
|
||||
UIManager.AddEvent(favContainer.gameObject, EventTriggerType.PointerClick, (e)=> {
|
||||
var gou = e.selectedObject.transform.Find("Gou").gameObject;
|
||||
@@ -483,6 +491,7 @@ public class GameRoomListController : PFUIPanel
|
||||
MapUDPService.SendCreateGameRoom(RoomName, selectedRouteId, Roompwd, UIManager.Now.GetDateTime(), CloseTime, Members, Map.AverageGrade, (Map.TotalClimb ?? 0), Map.Distance, Map.Enable3D, Map.EnableAR, Map.Name, Map.FileName, Map.Url, Map.AltitudeGraph);
|
||||
MapList.SetActive(false);
|
||||
CreateClicked = true;
|
||||
Query();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -493,6 +502,7 @@ public class GameRoomListController : PFUIPanel
|
||||
btn40 = right2.transform.Find("btn40").gameObject;
|
||||
btn50 = right2.transform.Find("btn50").gameObject;
|
||||
btn60 = right2.transform.Find("btn60").gameObject;
|
||||
btnMore = right2.transform.Find("btnMore").gameObject;
|
||||
//房间人数
|
||||
btn2 = right2.transform.Find("btn2").gameObject;
|
||||
btn3 = right2.transform.Find("btn3").gameObject;
|
||||
@@ -504,16 +514,19 @@ public class GameRoomListController : PFUIPanel
|
||||
var minInputField = right2.transform.Find("MinInputField").GetComponent<InputField>();
|
||||
var roomNameInputField = right2.transform.Find("RoomNameInputField").GetComponent<InputField>();
|
||||
var passwordInputField = right2.transform.Find("PasswordInputField").GetComponent<InputField>();
|
||||
btnMore.SetActive(true);
|
||||
hourInputField.gameObject.SetActive(false);
|
||||
minInputField.gameObject.SetActive(false);
|
||||
hourInputField.text = "0";
|
||||
minInputField.text = "0";
|
||||
roomNameInputField.text = "";
|
||||
passwordInputField.text = "";
|
||||
RoomName = "";
|
||||
RoomName = App.CurrentUser.Nickname + App.GetLocalString("'s Room");
|
||||
Roompwd = "";
|
||||
roomNameInputField.text = RoomName;
|
||||
passwordInputField.text = "";
|
||||
hourInputField.GetComponent<Outline>().enabled = false;
|
||||
HandleFormInput();
|
||||
HandleCloseTimeBtnClick(0, "");
|
||||
HandleMembersBtnClick(0, "");
|
||||
HandleMembersBtnClick(6, btn6.name);//默认6人
|
||||
HandleCloseTimeBtnClick(30, btn30.name);//默认关门时间30min
|
||||
roomNameInputField.onValueChanged.RemoveAllListeners();
|
||||
//房间名
|
||||
roomNameInputField.onValueChanged.AddListener((e) => {
|
||||
@@ -526,6 +539,7 @@ public class GameRoomListController : PFUIPanel
|
||||
Roompwd = e;
|
||||
HandleFormInput();
|
||||
});
|
||||
|
||||
UIManager.AddEvent(minInputField.gameObject, EventTriggerType.Select, (e) => {
|
||||
hourInputField.GetComponent<Outline>().enabled = true;
|
||||
HandleFormInput();
|
||||
@@ -546,6 +560,12 @@ public class GameRoomListController : PFUIPanel
|
||||
{
|
||||
HandleCloseTimeBtnClick(60, btn60.name);
|
||||
});
|
||||
UIManager.AddEvent(btnMore, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
btnMore.SetActive(false);
|
||||
hourInputField.gameObject.SetActive(true);
|
||||
minInputField.gameObject.SetActive(true);
|
||||
});
|
||||
//小时
|
||||
hourInputField.onValueChanged.RemoveAllListeners();
|
||||
hourInputField.onValueChanged.AddListener((e) => {
|
||||
@@ -560,7 +580,9 @@ public class GameRoomListController : PFUIPanel
|
||||
CloseTime = hours * 60 + mins;
|
||||
HandleCloseTimeBtnClick(CloseTime, minInputField.name);
|
||||
});
|
||||
|
||||
//房间人数
|
||||
|
||||
UIManager.AddEvent(btn2, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
HandleMembersBtnClick(2, btn2.name);
|
||||
@@ -877,7 +899,7 @@ public class GameRoomListController : PFUIPanel
|
||||
next.GetComponent<Button>().interactable = false;
|
||||
next.GetComponent<Button>().enabled = false;
|
||||
HandleStepBtn(previous.name);
|
||||
HandleCloseTimeBtnClick(0, "");
|
||||
HandleCloseTimeBtnClick(30, btn30.name);//默认关门时间30min
|
||||
|
||||
MapList.SetActive(true);
|
||||
}
|
||||
@@ -885,6 +907,7 @@ public class GameRoomListController : PFUIPanel
|
||||
{
|
||||
base.OnDisable();
|
||||
MapUDPService.MessageListener = null;
|
||||
App.Model = "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user