对战初步完成
This commit is contained in:
1 parent
b0c0890ca3
commit
509c309252
55 files changed
+7079
-6748
No files matched your search
@@ -48,7 +48,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
App.TextureCache.Clear();
|
||||
mapApi = new MapApi();
|
||||
//ShowLoading();
|
||||
ShowLoading();
|
||||
}
|
||||
|
||||
public float GetProcess()
|
||||
{
|
||||
return process;
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
@@ -195,7 +200,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cyclingController.ReSetUIManager();
|
||||
cyclingController.GoContinueRide();
|
||||
}
|
||||
protected virtual void StartRide(BaseEventData baseEvent)
|
||||
public virtual void StartRide(BaseEventData baseEvent)
|
||||
{
|
||||
if (!rideNow.IsInteractable())
|
||||
return;
|
||||
@@ -207,6 +212,16 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
StartGame();
|
||||
}
|
||||
|
||||
public void StartRide(int seconds)
|
||||
{
|
||||
processText.gameObject.SetActive(true);
|
||||
slider.gameObject.SetActive(true);
|
||||
depressFlag = true;
|
||||
slider.DOValue(process, 0);
|
||||
StartGame();
|
||||
transform.gameObject.SetActive(false);
|
||||
}
|
||||
protected virtual void Cancel(BaseEventData baseEvent)
|
||||
{
|
||||
SceneManager.LoadScene("MainScene");
|
||||
|
||||
@@ -719,6 +719,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
case CyclingModel.Competition:
|
||||
cyclingController = new CompetitionModel(route, selectParamModel, currentPlayer);
|
||||
break;
|
||||
case CyclingModel.GameRoom:
|
||||
cyclingController = new GameModel(route, selectParamModel);
|
||||
break;
|
||||
}
|
||||
GameStart();
|
||||
InitPlayer();//初始化人物方向等
|
||||
|
||||
@@ -40,9 +40,19 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
protected override void ShowLoading()
|
||||
{
|
||||
loadingPanel = panel.transform.Find("LoadingPanel").gameObject;
|
||||
loadingPanel.showLoadingExtension();
|
||||
if (App.gameRoomDetail != null)
|
||||
{
|
||||
ShowGameRoomLoading();
|
||||
loadingPanel = panel.transform.Find("LoadingPanel").gameObject;
|
||||
loadingPanel.showLoadingExtension();
|
||||
}
|
||||
}
|
||||
private void ShowGameRoomLoading()
|
||||
{
|
||||
UIManager.SetModalPanel(transform.Find("ModalPanel").GetComponent<PFUIPanel>());
|
||||
UIManager.ShowGameRoomLoadingPanel();
|
||||
}
|
||||
|
||||
//初始化
|
||||
public override void Init()
|
||||
{
|
||||
|
||||
@@ -34,9 +34,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
protected override void CreateList()
|
||||
{
|
||||
OnlineUserNum.text = " "+ MapUDPService.GetNearRiderCount().ToString();
|
||||
var roomId = cyclingController.cyclingController == null ? 0 : (cyclingController.cyclingController.recorderData.RoomId ?? 0);
|
||||
OnlineUserNum.text = " "+ MapUDPService.GetNearRiderCount(roomId).ToString();
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(OnlineUserNum.rectTransform);
|
||||
var nearList = MapUDPService.GetNearRiderData(pageIndex, pageSize, new double[] { playerController.Currentlatlong.x, playerController.Currentlatlong.y });
|
||||
var nearList = MapUDPService.GetNearRiderData(pageIndex, pageSize, new double[] { playerController.Currentlatlong.x, playerController.Currentlatlong.y },roomId);
|
||||
if (nearList == null)
|
||||
return;
|
||||
var mod = MapUDPService.GetNearRiderCount() % pageSize;
|
||||
|
||||
@@ -17,8 +17,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
UIManager.AddEvent(singleButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, SingleRide);
|
||||
UIManager.AddEvent(shadowButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShadowRide);
|
||||
UIManager.AddEvent(addButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShowSelectPlayer);
|
||||
|
||||
selectPanel.SetActive(true);//显示选择单人、影子骑行模式
|
||||
if (App.gameRoomDetail == null)
|
||||
{
|
||||
selectPanel.SetActive(true);//显示选择单人、影子骑行模式
|
||||
}
|
||||
}
|
||||
protected override void Update()
|
||||
{
|
||||
@@ -151,5 +153,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
countDownTxt.gameObject.SetActive(true);
|
||||
countDownTxt.text = count.ToString();
|
||||
}
|
||||
|
||||
public void StartRide(int seconds)
|
||||
{
|
||||
mainController.SetCyclingModel(CyclingModel.GameRoom);
|
||||
count = seconds;
|
||||
startPanel.SetActive(false);
|
||||
startBtn.gameObject.SetActive(false);
|
||||
countDownTxt.gameObject.SetActive(true);
|
||||
countDownTxt.text = count.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user