Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts: # Assets/Scripts/Scenes/Ride/Scripts/ResultPanelScript.cs
This commit is contained in:
commit
b3f6bb6861
15 files changed
+1175
-529
No files matched your search
@@ -41,7 +41,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
GameObject goResultBtn;
|
||||
GameObject cancelBtn;
|
||||
GameObject shareWxBtn;
|
||||
GameObject shareButton;
|
||||
GameObject shareWxGpButton;
|
||||
Transform toolbar;
|
||||
#endregion
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
toolbar = transform.Find("ToolBarPanel");
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
shareWxBtn = transform.Find("ToolBarPanel/WeChatButton").gameObject;
|
||||
shareButton = transform.Find("ShareButton").gameObject;
|
||||
shareWxGpButton = transform.Find("ToolBarPanel/GoogleButton").gameObject;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -83,19 +83,25 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cyclingController = controller;
|
||||
cyclingController.AddEvent(goResultBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, GoResult);
|
||||
cyclingController.AddEvent(cancelBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Cancel);
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
cyclingController.AddEvent(shareWxBtn, EventTriggerType.PointerClick, shareToWx);
|
||||
cyclingController.AddEvent(shareButton, EventTriggerType.PointerClick, opneShare);
|
||||
}
|
||||
|
||||
private void opneShare(BaseEventData baseEventData)
|
||||
{
|
||||
((RectTransform)toolbar).pivot = new Vector2(0, ((RectTransform)toolbar).pivot.y);
|
||||
toolbar.gameObject.SetActive(true);
|
||||
shareButton.SetActive(false);
|
||||
toolbar.DOScaleX(1,1);
|
||||
cyclingController.AddEvent(shareWxGpButton, EventTriggerType.PointerClick, shareToWxGp);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void shareToWx(BaseEventData b)
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, "未安装微信");
|
||||
}
|
||||
}
|
||||
|
||||
private void shareToWxGp(BaseEventData b)
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user