fb分享;比赛页面箭头去了
This commit is contained in:
1 parent
7a7c1ee55c
commit
4d5523e2ff
9 files changed
+547
-430
No files matched your search
@@ -7,6 +7,8 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using Facebook.Unity;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@@ -64,6 +66,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
WeChatGpButton = transform.Find("ToolBarPanel/GoogleButton").gameObject;
|
||||
UIManager.AddEvent(WeChatButton, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShareWechat);
|
||||
UIManager.AddEvent(WeChatGpButton, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShareWechatGp);
|
||||
var fbButton = transform.Find("ToolBarPanel/FaceBookButton").gameObject;
|
||||
UIManager.AddEvent(fbButton, EventTriggerType.PointerClick, shareFb);
|
||||
#endif
|
||||
SpriteTop = Resources.Load<Sprite>("Images/Ride/Match/top-1");
|
||||
SpriteSecond = Resources.Load<Sprite>("Images/Ride/Match/top-2");
|
||||
@@ -72,6 +76,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
UIManager.AddEvent(closeBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Close);
|
||||
}
|
||||
|
||||
|
||||
float time = 1;
|
||||
private void Update()
|
||||
{
|
||||
@@ -244,6 +249,14 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Utils.showToast(null, "未安装微信");
|
||||
}
|
||||
}
|
||||
private void shareFb(BaseEventData arg0)
|
||||
{
|
||||
//cyclingController.competition.Title, "By " + App.CurrentUser.Nickname, null)
|
||||
FB.ShareLink(contentURL: new Uri($"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}"),
|
||||
contentTitle: cyclingController.competition.Title,
|
||||
contentDescription: "By " + App.CurrentUser.Nickname,
|
||||
photoURL: new Uri(cyclingController.competition.CoverImage));
|
||||
}
|
||||
|
||||
private void ShareWechatGp(BaseEventData baseEventData)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using System;
|
||||
using DG.Tweening;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Facebook.Unity;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@@ -90,9 +91,19 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
cyclingController.AddEvent(shareWxBtn, EventTriggerType.PointerClick, shareToWx);
|
||||
cyclingController.AddEvent(shareWxGpButton, EventTriggerType.PointerClick, shareToWxGp);
|
||||
var fbButton = transform.Find("ToolBarPanel/FaceBookButton").gameObject;
|
||||
cyclingController.AddEvent(fbButton, EventTriggerType.PointerClick, shareToFb);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void shareToFb(BaseEventData arg0)
|
||||
{
|
||||
FB.ShareLink(contentURL: new Uri($"{App.CurrentUser.WebHost}RoutesRecords/{cyclingController.RankingId}?Token={App.CurrentUser.cookie}"),
|
||||
contentTitle: cyclingController.mapRoute.Name,
|
||||
contentDescription: "By " + App.CurrentUser.Nickname,
|
||||
photoURL: new Uri(cyclingController.mapRoute.CoverImage));
|
||||
}
|
||||
|
||||
private void shareToWx(BaseEventData b)
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
|
||||
Reference in new issue
Block a user