pc暂存
This commit is contained in:
1 parent
f070f5a36c
commit
d811eb8514
19 files changed
+5298
-1749
No files matched your search
@@ -16,6 +16,7 @@ namespace Assets.Scripts.Apis
|
||||
protected async override Task<HttpResponseMessage> SendAsync(
|
||||
HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
var badreqText = App.GetLocalLanguage() == "zh" ? "请检查网络连接是否正常" : "Please check if the network connection is normal.";
|
||||
try
|
||||
{
|
||||
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
@@ -36,7 +37,7 @@ namespace Assets.Scripts.Apis
|
||||
}
|
||||
if (response.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
response.Content = new StringContent(new JsonResult<object> { result = false, errMsg = "Please check if the network connection is normal.", data = null }.ToString());
|
||||
response.Content = new StringContent(new JsonResult<object> { result = false, errMsg = badreqText, data = null }.ToString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@@ -46,7 +47,7 @@ namespace Assets.Scripts.Apis
|
||||
HttpResponseMessage httpResponse = new HttpResponseMessage
|
||||
{
|
||||
StatusCode = System.Net.HttpStatusCode.BadRequest,
|
||||
Content = new StringContent(new JsonResult<object> { result = false, errMsg = "Please check if the network connection is normal.", data = null }.ToString())
|
||||
Content = new StringContent(new JsonResult<object> { result = false, errMsg = badreqText, data = null }.ToString())
|
||||
};
|
||||
return httpResponse;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class WeChatController
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
mainActivityClass.CallStatic("ShareWebpageToWX", scene, url, title, description, image);
|
||||
#else
|
||||
#elif UNITY_IOS
|
||||
ShareUrlToWX(scene, url, title, description);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -73,18 +73,23 @@ public class MainController : BaseScene
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
msgLocation = 1 * msg.transform.localPosition;
|
||||
var msg2 = Instantiate<CanvasGroup>(msg);
|
||||
var msg3 = Instantiate<CanvasGroup>(msg);
|
||||
msg2.transform.SetParent(msg.transform.parent);
|
||||
msg3.transform.SetParent(msg.transform.parent);
|
||||
msg2.transform.localPosition = 1 * msgLocation;
|
||||
msg2.transform.localScale = Vector3.one;
|
||||
msg2.alpha = 0;
|
||||
msg3.transform.localPosition = 1 * msgLocation;
|
||||
msg3.transform.localScale = Vector3.one;
|
||||
msg3.alpha = 0;
|
||||
msgs = new List<CanvasGroup> { msg, msg2, msg3 };
|
||||
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
|
||||
var go = transform.Find("GameObject");
|
||||
rightMessage = Instantiate<CanvasGroup>(msg);
|
||||
DestroyImmediate(transform.Find("GameObject/Message").gameObject);
|
||||
rightMessage.transform.SetParent(go);
|
||||
rightMessage.transform.localScale = Vector3.one;
|
||||
rightMessage.transform.localPosition = 1 * msgLocation;
|
||||
rightMessage.alpha = 0;
|
||||
msgs = new List<CanvasGroup> { rightMessage };
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
var tmpm = Instantiate<CanvasGroup>(rightMessage);
|
||||
tmpm.transform.SetParent(rightMessage.transform.parent);
|
||||
tmpm.transform.localPosition = 1 * msgLocation;
|
||||
tmpm.transform.localScale = Vector3.one;
|
||||
tmpm.alpha = 0;
|
||||
msgs.Add(tmpm);
|
||||
}
|
||||
#else
|
||||
msgLocation = new Vector3(168, 37-46, 0);
|
||||
var go = transform.Find("GameObject");
|
||||
@@ -121,22 +126,26 @@ public class MainController : BaseScene
|
||||
{
|
||||
//msg.transform.Find("Content")
|
||||
emptyt = 0;
|
||||
#if UNITY_STANDALONE_WIN
|
||||
Debug.Log(e.content);
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
DoMessage(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoMessageRight(e);
|
||||
}
|
||||
#else
|
||||
//#if UNITY_STANDALONE_WIN
|
||||
// Debug.Log(e.content);
|
||||
// if (App.currentPageIsHome)
|
||||
// {
|
||||
// DoMessage(e);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// DoMessageRight(e);
|
||||
// }
|
||||
//#else
|
||||
// if (App.currentPageIsHome)
|
||||
// {
|
||||
// DoMessage6(e);
|
||||
// }
|
||||
//#endif
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
DoMessage6(e);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
private void DoMessageRight(LinkedMessageEvent e)
|
||||
{
|
||||
@@ -170,6 +179,11 @@ public class MainController : BaseScene
|
||||
}
|
||||
msgIndex++;
|
||||
}
|
||||
#if UNITY_STANDALONE_WIN
|
||||
float moveOffset = 46;
|
||||
#else
|
||||
float moveOffset = 38;
|
||||
#endif
|
||||
private void DoMessage6(LinkedMessageEvent e)
|
||||
{
|
||||
var selectIndex = msgIndex % 5;
|
||||
@@ -181,7 +195,7 @@ public class MainController : BaseScene
|
||||
//m.transform.DOLocalMoveY(m.transform.localPosition.y - 38, 0.5f);
|
||||
foreach (var item in msgs)
|
||||
{
|
||||
se.Join(item.transform.DOLocalMoveY(item.transform.localPosition.y - 38, 0.5f));
|
||||
se.Join(item.transform.DOLocalMoveY(item.transform.localPosition.y - moveOffset, 0.5f));
|
||||
}
|
||||
se.Join(m.DOFade(0, 0.5f));
|
||||
se.Play().onComplete = () =>
|
||||
@@ -199,7 +213,7 @@ public class MainController : BaseScene
|
||||
for (int i = 0; i < msgIndex; i++)
|
||||
{
|
||||
var rect = msgs[i].GetComponent<RectTransform>();
|
||||
se.Join(rect.DOLocalMoveY(rect.localPosition.y - 38, 0.5f));
|
||||
se.Join(rect.DOLocalMoveY(rect.localPosition.y - moveOffset, 0.5f));
|
||||
}
|
||||
se.Join(m.DOFade(1, 0.5f));
|
||||
se.Play();
|
||||
@@ -210,17 +224,6 @@ public class MainController : BaseScene
|
||||
|
||||
void FinishMessage(object sender)
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
if ((bool)sender)
|
||||
{
|
||||
FinishMessageRight();
|
||||
}
|
||||
else
|
||||
{
|
||||
FinishMessageLeft();
|
||||
}
|
||||
#else
|
||||
|
||||
if (!(bool)sender)
|
||||
{
|
||||
//FinishMessage6();
|
||||
@@ -228,11 +231,23 @@ public class MainController : BaseScene
|
||||
DOTween.CompleteAll(true);
|
||||
transform.Find("GameObject").gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
transform.Find("GameObject").gameObject.SetActive(true);
|
||||
}
|
||||
#endif
|
||||
//#if UNITY_STANDALONE_WIN
|
||||
// if ((bool)sender)
|
||||
// {
|
||||
// FinishMessageRight();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FinishMessageLeft();
|
||||
// }
|
||||
//#else
|
||||
|
||||
|
||||
//#endif
|
||||
}
|
||||
void FinishMessageLeft()
|
||||
{
|
||||
@@ -347,9 +362,9 @@ public class MainController : BaseScene
|
||||
if (App.MainSceneParam["Name"] == "UserInfoPanel")
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
UIManager.ShowResultListPanel();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if (App.MainSceneParam["Name"] == "RaceHomePanel")
|
||||
|
||||
@@ -166,6 +166,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#else
|
||||
var prefab = Resources.Load<GameObject>("UI/Prefab/Ride/RankingItem");
|
||||
var myprefab = Resources.Load<GameObject>("UI/Prefab/Ride/MySelfRankingItem");
|
||||
var viewAllbtn = Resources.Load<GameObject>("UI/Prefab/Ride/ViewAll");
|
||||
#endif
|
||||
var parent = panel.transform.Find("MapRanking");
|
||||
var title = panel.transform.Find("RankingTitle").gameObject;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//绑定路书信息
|
||||
date.text = record.StartTime.ToString("yyyy-MM-dd");
|
||||
#else
|
||||
date.text = record.StartTime.ToShortDateString("yyyy-MM-dd");
|
||||
date.text = record.StartTime.ToShortDateString();
|
||||
#endif
|
||||
time.text = record.StartTime.ToShortTimeString();
|
||||
level.text = route.Hard;
|
||||
|
||||
@@ -128,12 +128,12 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
Utils.DisplayImageTempDict(transform.Find("MapHBImg").GetComponent<RawImage>(), myMap.AltitudeGraph, this.caches);
|
||||
|
||||
SetActive4Button(false);
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
|
||||
var isRecent = App.CurrentRouteType == "Recent Routes" && myMap.RecentRecord != null && myMap.RecentRecord.ContinueCyclingParam != null && !isModal;
|
||||
transform.Find("BtnContinue").gameObject.SetActive(isRecent);
|
||||
transform.Find("BtnReride").gameObject.SetActive(isRecent);
|
||||
transform.Find("MapHBImg").gameObject.SetActive(!isRecent);
|
||||
if (isRecent)
|
||||
if (isRecent)
|
||||
{
|
||||
transform.Find("BtnContinue").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.Find("BtnReride").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
@@ -148,7 +148,6 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
});
|
||||
transform.Find("BtnReride").GetComponent<Button>().onClick.AddListener(Ride);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private void Ride()
|
||||
@@ -185,6 +184,10 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
if (isModal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
if (localY != null)
|
||||
{
|
||||
@@ -196,14 +199,15 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
//SetActive4Button(false);
|
||||
SetColor(false);
|
||||
#else
|
||||
if (!isModal)
|
||||
{
|
||||
transform.Find("Shadow").GetComponent<Image>().DOFade(0, 0.3f);
|
||||
}
|
||||
transform.Find("Shadow").GetComponent<Image>().DOFade(0, 0.3f);
|
||||
#endif
|
||||
}
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
if (isModal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
if (localY == null)
|
||||
{
|
||||
@@ -216,10 +220,7 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
//SetActive4Button(true);
|
||||
SetColor(true);
|
||||
#else
|
||||
if (!isModal)
|
||||
{
|
||||
transform.Find("Shadow").GetComponent<Image>().DOFade(1, 0.3f);
|
||||
}
|
||||
transform.Find("Shadow").GetComponent<Image>().DOFade(1, 0.3f);
|
||||
#endif
|
||||
}
|
||||
void SetActive4Button(bool b)
|
||||
|
||||
@@ -318,11 +318,11 @@ public class MapListController : PFUIPanel
|
||||
mc.gameObject.SetActive(true);
|
||||
mc.GetComponent<CanvasGroup>().alpha = 0;
|
||||
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
|
||||
#endif
|
||||
if (isFocusSearch)
|
||||
{
|
||||
topRect.Find("SearchInput").GetComponent<InputField>().OnPointerClick(new PointerEventData(EventSystem.current));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void onEndEdit()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user