Merge branch 'dev_cyp' into dev

# Conflicts:
#	Assets/Scripts/App.cs
#	Assets/Scripts/UIManager.cs
This commit is contained in:
suntao committed 2021-05-08 11:15:28 +08:00
commit 92676d7cf8
20 files changed
+1641 -1364

No files matched your search

+12
View File
@@ -69,6 +69,17 @@ public class Confirm : PFUIPanel
_callback = callback;
}
public void SetType(int type)
{
string ok = "Ok",cancel = "Cancel";
if (type == 2)
{
ok = "Yes";
cancel = "No";
}
_ok.transform.Find("Text").GetComponent<Text>().text = ok;
_cancel.transform.Find("Text").GetComponent<Text>().text = cancel;
}
// Update is called once per frame
void Update()
{
@@ -97,4 +108,5 @@ public class Confirm : PFUIPanel
this.gameObject.SetActive(false);
});
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ public class MainNav : MonoBehaviour
{
UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", ()=> {
Application.Quit();
});
},2);
});
UIManager.AddEvent(transform.Find("Setting").gameObject, EventTriggerType.PointerClick, x =>
+29 -3
View File
@@ -96,7 +96,7 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
SceneManager.LoadScene("Ride");
});
transform.Find("Name").GetComponent<Text>().text = myMap.Name;
Utils.DisplayImage(StartCoroutine, transform.Find("MapTitleImg").GetComponent<RawImage>(), myMap.CoverImage);
transform.Find("Hot").gameObject.SetActive(myMap.IsFire);
var props = transform.Find("Props");
@@ -115,7 +115,30 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
UIManager.Instance.collectDict[myMap.IsFavorite];
transform.Find("BtnInfo").GetComponent<Button>().onClick.AddListener(Info);
transform.Find("BtnRide").GetComponent<Button>().onClick.AddListener(Ride);
Utils.DisplayImage(StartCoroutine, transform.Find("MapHBImg").GetComponent<RawImage>(), myMap.AltitudeGraph);
if (App.propTextureCache["mapImgCache"].ContainsKey(myMap.Id))
{
transform.Find("MapTitleImg").GetComponent<RawImage>().texture =
App.propTextureCache["mapImgCache"][myMap.Id];
}
else
{
Utils.DisplayImage(StartCoroutine, transform.Find("MapTitleImg").GetComponent<RawImage>(), myMap.CoverImage, (t) =>
{
App.propTextureCache["mapImgCache"].Add(myMap.Id, t);
});
}
if (App.propTextureCache["mapHBCache"].ContainsKey(myMap.Id))
{
transform.Find("MapHBImg").GetComponent<RawImage>().texture =
App.propTextureCache["mapHBCache"][myMap.Id];
}
else
{
Utils.DisplayImage(StartCoroutine, transform.Find("MapHBImg").GetComponent<RawImage>(), myMap.AltitudeGraph,(t)=>
{
App.propTextureCache["mapHBCache"].Add(myMap.Id, t);
});
}
SetActive4Button(false);
}
@@ -159,7 +182,10 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
}
public void OnPointerExit(PointerEventData eventData)
{
transform.DOLocalMoveY(localY.Value, 0.3f);
if (localY != null)
{
transform.DOLocalMoveY(localY.Value, 0.3f);
}
transform.Find("CollectImg").gameObject.SetActive(false);
transform.Find("Shadow").gameObject.SetActive(false);
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
@@ -256,9 +256,9 @@ public class EditUserController : PFUIPanel
{
UIManager.ShowConfirm("Logout", "Do you want to log out and change accounts?", () =>
{
SceneManager.LoadScene("1-Login");
SceneManager.LoadScene("Login");
UIManager.CloseConfirm();
});
},2);
}
// Update is called once per frame
@@ -32,9 +32,9 @@ public class UserInfoController : PFUIPanel
{
UIManager.ShowConfirm("Logout", "Do you want to log out and change accounts?", () =>
{
SceneManager.LoadScene("1-Login");
SceneManager.LoadScene("Login");
UIManager.CloseConfirm();
});
},2);
});
infoPanel = transform.Find("InfoPanel").Find("P");
@@ -34,7 +34,17 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
left = transform.Find("Left");
row1 = left.Find("Main").Find("Row1");
row2 = left.Find("Main").Find("Row2");
Utils.DisplayImage(StartCoroutine, transform.Find("CoverImage").GetComponent<RawImage>(), result.RouteImage);
if (App.propTextureCache["recordCache"].ContainsKey(result.Id))
{
transform.Find("CoverImage").GetComponent<RawImage>().texture = App.propTextureCache["recordCache"][result.Id];
}
else
{
Utils.DisplayImage(StartCoroutine, transform.Find("CoverImage").GetComponent<RawImage>(), result.RouteImage,(t)=>
{
App.propTextureCache["recordCache"].Add(result.Id, t);
});
}
left.Find("Main").Find("Name").GetComponent<Text>().text = result.RouteName;
left.Find("Main").Find("Time").GetComponent<Text>().text = result.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
row1.Find("Time").GetComponent<Text>().text = $"<color={titleColor}>Riding time:</color>{result.TrainingTime}";