登录页一些特效,路书列表详情框架

This commit is contained in:
Caiyanpeng committed 2021-04-01 11:01:05 +08:00
1 parent 326b74bd03
commit 996f924719
50 files changed
+19916 -6804

No files matched your search

@@ -1,21 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class MapListScript : MonoBehaviour, IEndDragHandler
{
public void OnEndDrag(PointerEventData eventData)
{
var sc = gameObject.transform.parent.GetComponent<MapListController>();
if (eventData.position.y < 0)
{
sc.Refresh();
}
if (eventData.position.y + Screen.height > sc.Content.GetComponent<RectTransform>().rect.height)
{
sc.pageIndex++;
sc.GetList();
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5b590b8b6670b334ea1953fea1deba17
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+10 -15
View File
@@ -15,9 +15,9 @@ public class MyMap
public class MapScript : MonoBehaviour
{
// Start is called before the first frame update
[SerializeField] Text text;
[SerializeField] GameObject panel;
[SerializeField] RawImage rawImage;
//[SerializeField] Text text;
//[SerializeField] GameObject panel;
//[SerializeField] RawImage rawImage;
void Start()
{
}
@@ -31,19 +31,14 @@ public class MapScript : MonoBehaviour
{
gameObject.GetComponent<Button>().onClick.AddListener(()=>
{
UIManager.ShowMapDetailPanel(myMap.Id);
//SceneManager.LoadScene("4-Demo", LoadSceneMode.Additive);
});
text.text = myMap.Name;
Utils.DisplayImage(StartCoroutine, rawImage, myMap.CoverImage);
int i = 0;
foreach (RectTransform transform in panel.transform)
{
//if (i < myMap.rank && i < 5)
if (i < 3 && i<5)
{
transform.GetComponent<Image>().color = new Color(255, 255, 0);
i++;
}
}
transform.Find("Name").GetComponent<Text>().text = myMap.Name;
Utils.DisplayImage(StartCoroutine, transform.Find("MapTitleImg").GetComponent<RawImage>(), myMap.CoverImage);
var props = transform.Find("Props");
props.Find("DistanceText").GetComponent<Text>().text = $"{myMap.Distance.ToString("#0.00")}KM";
props.Find("EleText").GetComponent<Text>().text = $"{(myMap.TotalClimb ?? 0.0).ToString("#0.00")}M";
props.Find("SlopeText").GetComponent<Text>().text = $"{myMap.AverageGrade.ToString("#0.00")}%";
}
}