Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
This commit is contained in:
commit
750d9107b4
File diff suppressed because it is too large
Load Diff
@ -369,7 +369,7 @@ public class DeviceView : MonoBehaviour
|
|||||||
case SensorType.Power:
|
case SensorType.Power:
|
||||||
return (connectedDevice as IPowerDevice).Power.ToString();
|
return (connectedDevice as IPowerDevice).Power.ToString();
|
||||||
case SensorType.Speed:
|
case SensorType.Speed:
|
||||||
return (connectedDevice as ISpeedDevice).Speed.ToString();
|
return (connectedDevice as ISpeedDevice).Speed.ToString("f1");
|
||||||
case SensorType.Trainer:
|
case SensorType.Trainer:
|
||||||
//powerValue.text = (connectedDevice as IPowerDevice).Power.ToString();
|
//powerValue.text = (connectedDevice as IPowerDevice).Power.ToString();
|
||||||
//cadenceValue.GetComponent<Text>().text = (connectedDevice as ICadenceDevice).Cadence.ToString();
|
//cadenceValue.GetComponent<Text>().text = (connectedDevice as ICadenceDevice).Cadence.ToString();
|
||||||
|
|||||||
@ -231,8 +231,9 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
|||||||
//{
|
//{
|
||||||
// position.y = position.z;
|
// position.y = position.z;
|
||||||
//}
|
//}
|
||||||
|
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||||
this.Move(position);
|
this.Move(position);
|
||||||
|
#endif
|
||||||
this.gameObject.SetActive(true);
|
this.gameObject.SetActive(true);
|
||||||
|
|
||||||
//this.SetModel(model);
|
//this.SetModel(model);
|
||||||
@ -254,6 +255,7 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
|||||||
|
|
||||||
public void Move(Vector3 position)
|
public void Move(Vector3 position)
|
||||||
{
|
{
|
||||||
|
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||||
this.transform.position = position;
|
this.transform.position = position;
|
||||||
|
|
||||||
var localPosition = this.transform.localPosition;
|
var localPosition = this.transform.localPosition;
|
||||||
@ -282,11 +284,16 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
|||||||
this.transform.localScale = new Vector2(2, 2);
|
this.transform.localScale = new Vector2(2, 2);
|
||||||
|
|
||||||
Debug.Log($"{ this.transform.localPosition.y }, { this.transform.localPosition.y }");
|
Debug.Log($"{ this.transform.localPosition.y }, { this.transform.localPosition.y }");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Hide()
|
public void Hide()
|
||||||
{
|
{
|
||||||
|
#if UNITY_ANDROID || UNITY_IOS
|
||||||
|
this.gameObject.SetActive(false);
|
||||||
|
#else
|
||||||
DestroyImmediate(this.gameObject);
|
DestroyImmediate(this.gameObject);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPointerUp(PointerEventData eventData)
|
public void OnPointerUp(PointerEventData eventData)
|
||||||
|
|||||||
@ -39,7 +39,11 @@ public class BigMapController : PFUIPanel
|
|||||||
{
|
{
|
||||||
if (_tips == null)
|
if (_tips == null)
|
||||||
{
|
{
|
||||||
|
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||||
_tips = ((GameObject)Instantiate(tipsObject, canvas.transform.Find("TipsContainer"))).GetComponent<MapItem>();
|
_tips = ((GameObject)Instantiate(tipsObject, canvas.transform.Find("TipsContainer"))).GetComponent<MapItem>();
|
||||||
|
#else
|
||||||
|
_tips = canvas.transform.Find("TipsContainer/MapItem-Mobile").GetComponent<MapItem>();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return _tips;
|
return _tips;
|
||||||
}
|
}
|
||||||
@ -85,7 +89,6 @@ public class BigMapController : PFUIPanel
|
|||||||
canvas = this.transform.Find("Canvas").gameObject;
|
canvas = this.transform.Find("Canvas").gameObject;
|
||||||
#if UNITY_ANDROID || UNITY_IOS
|
#if UNITY_ANDROID || UNITY_IOS
|
||||||
mainContainer = canvas.transform.Find("MainContainer").gameObject;
|
mainContainer = canvas.transform.Find("MainContainer").gameObject;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
mainContainer = canvas;
|
mainContainer = canvas;
|
||||||
#endif
|
#endif
|
||||||
@ -334,7 +337,9 @@ public class BigMapController : PFUIPanel
|
|||||||
if(item.Value.Selected)
|
if(item.Value.Selected)
|
||||||
{
|
{
|
||||||
tips.Hide();
|
tips.Hide();
|
||||||
|
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||||
tips = null;
|
tips = null;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -402,20 +407,23 @@ public class BigMapController : PFUIPanel
|
|||||||
if(_tips != null)
|
if(_tips != null)
|
||||||
{
|
{
|
||||||
_tips.Hide();
|
_tips.Hide();
|
||||||
|
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||||
_tips = null;
|
_tips = null;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (line.Selected)
|
if (line.Selected)
|
||||||
{
|
{
|
||||||
line.Selected = false;
|
line.Selected = false;
|
||||||
//tips.Hide();
|
//tips.Hide();
|
||||||
//tips = null;
|
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||||
|
tips = null;
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
line.Selected = true;
|
line.Selected = true;
|
||||||
//iii.Selected(true);
|
//iii.Selected(true);
|
||||||
var position = line.BeginMarker.transform.position;
|
var position = line.BeginMarker.transform.position;
|
||||||
//position.z += 25;
|
//position.z += 25;
|
||||||
position = DefaultPosition();
|
|
||||||
tips.Show(position, line.Model);
|
tips.Show(position, line.Model);
|
||||||
|
|
||||||
foreach (var item in linesCache)
|
foreach (var item in linesCache)
|
||||||
@ -450,7 +458,7 @@ public class BigMapController : PFUIPanel
|
|||||||
|
|
||||||
var position = line.BeginMarker.transform.position;
|
var position = line.BeginMarker.transform.position;
|
||||||
//position.z += 25;
|
//position.z += 25;
|
||||||
position = DefaultPosition();
|
|
||||||
tips.Show(position, line.Model);
|
tips.Show(position, line.Model);
|
||||||
|
|
||||||
foreach (var item in linesCache)
|
foreach (var item in linesCache)
|
||||||
@ -478,7 +486,6 @@ public class BigMapController : PFUIPanel
|
|||||||
var position = line.BeginMarker.transform.position;
|
var position = line.BeginMarker.transform.position;
|
||||||
//position.z += 25;
|
//position.z += 25;
|
||||||
//tips.Show(position, line.Model);
|
//tips.Show(position, line.Model);
|
||||||
position = DefaultPosition();
|
|
||||||
tips.Move(position);
|
tips.Move(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -501,16 +508,6 @@ 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
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
@ -530,8 +527,6 @@ public class BigMapController : PFUIPanel
|
|||||||
if (_tips != null)
|
if (_tips != null)
|
||||||
{
|
{
|
||||||
_tips.Hide();
|
_tips.Hide();
|
||||||
_tips = null;
|
|
||||||
canvas.transform.Find("TipsContainer").gameObject.SetActive(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user