Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
This commit is contained in:
commit
49c264ff36
3 files changed
+424
-378
No files matched your search
@@ -17,7 +17,7 @@ namespace Assets.Scripts.Devices.Ble.Devices
|
||||
public int Cadence { get => _cyclingSpeedCadenceMeasurement.Cadence; set => throw new NotImplementedException(); }
|
||||
public double Speed { get => _cyclingSpeedCadenceMeasurement.Speed; set => throw new NotImplementedException(); }
|
||||
|
||||
private double _wheelCircumference;
|
||||
private double _wheelCircumference => 2096;
|
||||
private List<BleServiceInfo> Services;
|
||||
public SpeedCadence(BlePeripheralInfo peripheralInfo, IBleWinHwInterface bleWinHwInterface) : base(peripheralInfo, bleWinHwInterface, Ant.SensorType.SpeedCadence)
|
||||
{
|
||||
|
||||
@@ -113,14 +113,27 @@ public class BigMapController : PFUIPanel
|
||||
#endif
|
||||
|
||||
var qtcm = this.transform.Find("Map").GetComponent<QuadTreeCameraMovement>();
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
var scroll = panel.Find("Scroll View").gameObject;
|
||||
|
||||
UIManager.AddEvent(scroll, EventTriggerType.BeginDrag, (e) =>
|
||||
{
|
||||
qtcm.enabled = false;
|
||||
});
|
||||
UIManager.AddEvent(scroll, EventTriggerType.EndDrag, (e) =>
|
||||
{
|
||||
qtcm.enabled = true;
|
||||
});
|
||||
#else
|
||||
UIManager.AddEvent(panel.gameObject, EventTriggerType.PointerEnter, (e) =>
|
||||
{
|
||||
{
|
||||
qtcm.enabled = false;
|
||||
});
|
||||
UIManager.AddEvent(panel.gameObject, EventTriggerType.PointerExit, (e) =>
|
||||
{
|
||||
qtcm.enabled = true;
|
||||
});
|
||||
#endif
|
||||
|
||||
content = panel.Find("Scroll View").Find("Viewport").Find("Content").gameObject;
|
||||
var input = panel.Find("InputField");
|
||||
@@ -402,6 +415,7 @@ public class BigMapController : PFUIPanel
|
||||
//iii.Selected(true);
|
||||
var position = line.BeginMarker.transform.position;
|
||||
//position.z += 25;
|
||||
position = DefaultPosition();
|
||||
tips.Show(position, line.Model);
|
||||
|
||||
foreach (var item in linesCache)
|
||||
@@ -463,6 +477,7 @@ public class BigMapController : PFUIPanel
|
||||
var position = line.BeginMarker.transform.position;
|
||||
//position.z += 25;
|
||||
//tips.Show(position, line.Model);
|
||||
position = DefaultPosition();
|
||||
tips.Move(position);
|
||||
}
|
||||
}
|
||||
@@ -485,12 +500,42 @@ public class BigMapController : PFUIPanel
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vector3 DefaultPosition()
|
||||
{
|
||||
Vector3 vector3 = new Vector3(0.8f, 0.35f, 180f);
|
||||
////Debug.Log(vp);
|
||||
//var wd = Camera.main.WorldToScreenPoint(worldPosition);
|
||||
var wd = Camera.main.ViewportToWorldPoint(vector3);
|
||||
return wd;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//Debug.Log(Input.mousePosition.x + "," + Input.mousePosition.y + "," + Input.mousePosition.z);
|
||||
//timer += Time.deltaTime;
|
||||
|
||||
// Check if there is a touch
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
if ((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)) //检测手值的触碰
|
||||
{
|
||||
// Check if finger is over a UI element
|
||||
if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)) //监视是否触碰UI
|
||||
{
|
||||
var line = linesCache.Select(d => d.Value).FirstOrDefault(l => l.Selected);
|
||||
if (line != null)
|
||||
{
|
||||
line.Selected = false;
|
||||
if (_tips != null)
|
||||
{
|
||||
_tips.Hide();
|
||||
_tips = null;
|
||||
canvas.transform.Find("TipsContainer").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
//鼠标点击空白处,清除选择的路线
|
||||
if (Input.GetMouseButtonDown(0) && EventSystem.current.IsPointerOverGameObject() == false)
|
||||
{
|
||||
@@ -505,6 +550,7 @@ public class BigMapController : PFUIPanel
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Show(double lat, double lon)
|
||||
|
||||
Reference in new issue
Block a user