Merge remote-tracking branch 'origin/dev' into dev_lishuo

# Conflicts:
#	Assets/Cyp/Prefab.meta
#	Assets/Mapbox/Core/Plugins/Android.meta
#	Assets/Mapbox/Core/Plugins/Mapbox.meta
#	Assets/Mapbox/Core/Plugins/Mapbox/MapboxAccounts.meta
#	Assets/Plugins/Circle/ImageWithRoundedCorners.cs
#	Assets/Resources/Images/Devices.meta
#	Assets/Resources/UI/Prefab/Item.meta
#	Assets/Scripts/Devices/Ant/LegacyPages.meta
#	Assets/Scripts/UI/Prefab/Item.meta
#	Assets/StreamingAssets.meta
#	ProjectSettings/EditorBuildSettings.asset
This commit is contained in:
lishuo committed 2021-04-01 14:09:23 +08:00
commit ae9cefc645
144 files changed
+32337 -8064

No files matched your search

@@ -20,11 +20,11 @@ public class DeviceController : PFUIPanel
protected override void Start()
{
base.Start();
Button button = this.transform.Find("Button").GetComponent<Button>();
button.onClick.AddListener(() =>
{
UIManager.ShowHomePanel();
});
//Button button = this.transform.Find("Button").GetComponent<Button>();
//button.onClick.AddListener(() =>
//{
// UIManager.ShowHomePanel();
//});
this.toggle = this.transform.Find("Toggle").GetComponent<Toggle>();
this.toggle.onValueChanged.AddListener(s =>
@@ -46,7 +46,7 @@ public class DeviceController : PFUIPanel
timer -= Time.deltaTime;
if (timer <= 0)
{
this.toggle.isOn = AntConnector.Instance().IsAvailable;
//this.toggle.isOn = AntConnector.Instance().IsAvailable;
//foreach (var item in AntConnector.Instance().discoveredDevices)
//{
@@ -64,4 +64,9 @@ public class DeviceController : PFUIPanel
timer = 1.0f;
}
}
private void OnApplicationQuit()
{
AntConnector.Instance().Dispose();
}
}
@@ -0,0 +1,58 @@
using Assets.Scripts;
using Assets.Scripts.Apis.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class MapDetailController : MonoBehaviour
{
// Start is called before the first frame update
[HideInInspector] public int id = 0;
[HideInInspector] public MapRoute map;
void Start()
{
if (id != 0)
{
var r = ConfigHelper.mapApi.GetById(id);
if (r.result)
{
map = r.data;
}
else
{
Utils.showToast(gameObject, r.errMsg, 1);
}
}
if (transform.Find("BtnGoRide") != null)
{
transform.Find("BtnGoRide").GetComponent<Button>().onClick.AddListener(GoRide);
}
if (transform.Find("Name") != null)
{
transform.Find("Name").GetComponent<Text>().text = map.Name;
}
if (transform.Find("BtnReturn") != null)
{
transform.Find("BtnReturn").GetComponent<Button>().onClick.AddListener(() =>
{
UIManager.ShowHomePanel();
});
}
}
private void GoRide()
{
//Utils.showToast(gameObject, "去骑行", 1);
App.RouteIdParam = id;
SceneManager.LoadScene("Ride");
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 858ac526aed2cf641a3c0f50a8c7730d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,11 +1,13 @@
using Assets.Cyp.Common;
using Assets.Scripts;
using Assets.Scripts.Apis.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
@@ -14,7 +16,7 @@ public class MapListController : MonoBehaviour
// Start is called before the first frame update
[SerializeField] GameObject map;
[SerializeField] GameObject content;
[SerializeField] Dropdown hardSelector;
[SerializeField] GameObject scroll;
[HideInInspector] public int pageIndex = 0;
[HideInInspector] public int pageSize = 20;
[HideInInspector] public string hard = "全部";
@@ -27,33 +29,53 @@ public class MapListController : MonoBehaviour
private bool isEnd = false;
void Start()
{
if (hardSelector != null)
{
hardSelector.onValueChanged.AddListener(ChangeHard);
}
//if (hardSelector != null)
//{
// hardSelector.onValueChanged.AddListener(ChangeHard);
//}
if (content!=null)
{
var transform = content.transform.GetComponent<RectTransform>();
var layout = content.GetComponent<GridLayoutGroup>();
if (layout != null)
{
var width = transform.rect.width;
layout.cellSize = new Vector2((width - 120) / 5, (width - 120) / 5);
}
//var transform = content.transform.GetComponent<RectTransform>();
//var layout = content.GetComponent<GridLayoutGroup>();
//if (layout != null)
//{
// var width = transform.rect.width;
// layout.cellSize = new Vector2((width - 120) / 5, (width - 120) / 5);
//}
}
GetList();
if (scroll != null)
{
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
}
//UIManager.AddEvent(transform.Find("Panel").Find("Panel"))
//var obj = Instantiate(Resources.Load<GameObject>("Canvas"));
//obj.transform.parent = transform.parent;
}
private void ChangeHard(int index)
private void OnEndDrag(BaseEventData arg0)
{
var text = hardSelector.options[index].text;
if (text == "全部难度")
var scrollrect = scroll.GetComponent<ScrollRect>();
if (scrollrect.verticalNormalizedPosition <= 0)
{
Debug.Log(scrollrect.verticalNormalizedPosition);
pageIndex++;
GetList();
}
if (scrollrect.verticalNormalizedPosition >= 1)
{
Refresh();
}
}
private void ChangeHard(int index)
{
//var text = hardSelector.options[index].text;
//if (text == "全部难度")
//{
//}
}
public void GetList()
+11 -6
View File
@@ -9,12 +9,17 @@ using UnityEngine.EventSystems;
//namespace Assets.Scripts.UI.Prefab.Panel
//{
public class PFUIPanel : UIBehaviour
{
public class PFUIPanel : UIBehaviour
{
public void OpenURL(string url)
{
Application.OpenURL(url);
}
public void OpenURL(string url)
{
Application.OpenURL(url);
}
public virtual void Close()
{
DestroyImmediate(this.gameObject);
}
}
//}