调整样式
This commit is contained in:
1 parent
19766db051
commit
f065bf4bbb
43 files changed
+2290
-3097
No files matched your search
@@ -9,6 +9,7 @@ using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Assets.Scripts;
|
||||
|
||||
public class Tips : MonoBehaviour
|
||||
{
|
||||
@@ -30,6 +31,7 @@ public class Tips : MonoBehaviour
|
||||
private List<CountryModel> countryList;
|
||||
private GameObject level;
|
||||
private GameObject m3DIcon;
|
||||
private RawImage altitudeGraph;
|
||||
private void Awake()
|
||||
{
|
||||
var materialSource = Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial");
|
||||
@@ -63,6 +65,8 @@ public class Tips : MonoBehaviour
|
||||
level.GetComponent<Image>().material = material1;
|
||||
|
||||
m3DIcon = this.transform.Find("3DIcon").gameObject;
|
||||
|
||||
altitudeGraph = this.transform.Find("AltitudeGraph").GetComponent<RawImage>();
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
@@ -81,7 +85,7 @@ public class Tips : MonoBehaviour
|
||||
{
|
||||
if (this.isActiveAndEnabled)
|
||||
{
|
||||
if(_model.Id == model.Id)
|
||||
if(_model != null && _model.Id == model.Id)
|
||||
{
|
||||
//this.gameObject.SetActive(false);
|
||||
return;
|
||||
@@ -94,10 +98,10 @@ public class Tips : MonoBehaviour
|
||||
Name.text = _model.Name;
|
||||
|
||||
Count.text = _model.TheHeat.ToString();
|
||||
Distance.text = _model.Distance.ToString("#.0")+"KM";
|
||||
TotalClimb.text = _model.TotalClimb.ToString();
|
||||
Distance.text = _model.Distance.ToString("0.0")+"KM";
|
||||
TotalClimb.text = _model.TotalClimb.ToString("0") +"FT";
|
||||
|
||||
averageGrade.text = _model.AverageGrade.ToString() + "%";
|
||||
averageGrade.text = _model.AverageGrade.ToString("0.0") + "%";
|
||||
|
||||
//var country = countryList.SingleOrDefault(r => r.abbreviation.Equals(_model.CountryCode, StringComparison.InvariantCultureIgnoreCase));
|
||||
//if(country )
|
||||
@@ -110,7 +114,12 @@ public class Tips : MonoBehaviour
|
||||
level.transform.Find("Text").GetComponent<Text>().text = _model.Hard;
|
||||
|
||||
m3DIcon.SetActive(_model.Enable3D);
|
||||
|
||||
|
||||
|
||||
//altitudeGraph
|
||||
|
||||
Utils.DisplayImage(StartCoroutine, altitudeGraph, _model.AltitudeGraph);
|
||||
//Utils.DisplayImage(StartCoroutine, altitudeGraph, "http://192.168.0.97:5082/Map/AltitudeGraph?id=1215");
|
||||
}
|
||||
|
||||
|
||||
@@ -137,9 +146,11 @@ public class Tips : MonoBehaviour
|
||||
}
|
||||
this.transform.localPosition = localPosition;
|
||||
this.transform.localScale = new Vector2(2, 2);
|
||||
this.SetModel(model);
|
||||
|
||||
//tips.Show();
|
||||
this.gameObject.SetActive(true);
|
||||
|
||||
this.SetModel(model);
|
||||
}
|
||||
public void Hide()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user