对战与AR骑行相关逻辑修改
This commit is contained in:
1 parent
3bcb3ee83e
commit
89b5275efd
64 files changed
+50131
-29495
No files matched your search
@@ -0,0 +1,282 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.UI.UIEffect;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using Facebook.Unity;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class GameRoomResultPanelScript : MonoBehaviour
|
||||
{
|
||||
CyclingController cyclingController;
|
||||
RawImage Head;
|
||||
Text Ranking;
|
||||
Text Timer;
|
||||
GameObject Mine { get; set; }
|
||||
GameObject TitleImage { get; set; }
|
||||
GameObject WatchTitle { get; set; }
|
||||
GameObject RankingPanel { get; set; }
|
||||
GameObject ShareButton { get; set; }
|
||||
GameObject ToolBarPanel { get; set; }
|
||||
GameObject WeChatButton { get; set; }
|
||||
GameObject WeChatGpButton { get; set; }
|
||||
|
||||
|
||||
RawImage TopHead { get; set; }
|
||||
RawImage SecondHead { get; set; }
|
||||
RawImage ThirdHead { get; set; }
|
||||
Image Top { get; set; }
|
||||
Sprite SpriteTop { get; set; }
|
||||
Sprite SpriteSecond { get; set; }
|
||||
Sprite SpriteThrid { get; set; }
|
||||
|
||||
Text RankingTitle { get; set; }
|
||||
Text TimerTitle { get; set; }
|
||||
Text CloseTime { get; set; }
|
||||
Text CloseTitle { get; set; }
|
||||
private void Awake()
|
||||
{
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
var closeBtn = transform.Find("Close").gameObject;
|
||||
Head = transform.Find("Mine/Head").GetComponent<RawImage>();
|
||||
Ranking = transform.Find("Mine/Ranking").GetComponent<Text>();
|
||||
RankingTitle = transform.Find("Mine/RankingTitle").GetComponent<Text>();
|
||||
TimerTitle = transform.Find("Mine/TimerTitle").GetComponent<Text>();
|
||||
Timer = transform.Find("Mine/Timer").GetComponent<Text>();
|
||||
Top = transform.Find("Mine/TOP").GetComponent<Image>();
|
||||
Mine = transform.Find("Mine").gameObject;
|
||||
RankingPanel = transform.Find("Ranking").gameObject;
|
||||
TopHead = transform.Find("Ranking/TopHead").GetComponent<RawImage>();
|
||||
SecondHead = transform.Find("Ranking/SecondHead").GetComponent<RawImage>();
|
||||
ThirdHead = transform.Find("Ranking/ThirdHead").GetComponent<RawImage>();
|
||||
TitleImage = transform.Find("TitleImage").gameObject;
|
||||
WatchTitle = transform.Find("WatchTitle").gameObject;
|
||||
CloseTitle = transform.Find("CloseTitle").GetComponent<Text>();
|
||||
CloseTime = transform.Find("CloseTime").GetComponent<Text>();
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
ShareButton = transform.Find("ShareButton").gameObject;
|
||||
ToolBarPanel = transform.Find("ToolBarPanel").gameObject;
|
||||
WeChatButton = transform.Find("ToolBarPanel/WeChatButton").gameObject;
|
||||
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");
|
||||
SpriteThrid = Resources.Load<Sprite>("Images/Ride/Match/top-3");
|
||||
|
||||
UIManager.AddEvent(closeBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Close);
|
||||
}
|
||||
|
||||
|
||||
float time = 1;
|
||||
private void Update()
|
||||
{
|
||||
//var model = cyclingController.cyclingController as GameModel;
|
||||
//if (model != null)
|
||||
//{
|
||||
///var s = model.EndCountDown();
|
||||
//显示关门时间
|
||||
//var isshow = s.Item3 && s.Item1 >= 0 && !cyclingController.isWatch;
|
||||
//CloseTime.text = Helper.FormatTicks(s.Item1);
|
||||
//CloseTitle.gameObject.SetActive(isshow);
|
||||
//CloseTime.gameObject.SetActive(isshow);
|
||||
//}
|
||||
time -= Time.deltaTime;
|
||||
while (time < 0)
|
||||
{
|
||||
Refresh();
|
||||
time += 1;
|
||||
}
|
||||
}
|
||||
|
||||
private Color RED = new Color(0.9764706f, 0.1882353f, 0.5254902f);
|
||||
private Color SHALLOW_RED = new Color(1f, 0.454902f, 0.5215687f);
|
||||
|
||||
private Color PURPLE = new Color(0.1568628f, 0.4431373f, 0.8745098f);
|
||||
private Color SHALLOW_PURPLE = new Color(0.3843137f, 0.7764706f, 1f);
|
||||
|
||||
private Color BLUE = new Color(0.4352941f, 0.3333333f, 0.9372549f);
|
||||
private Color SHALLOW_BLUE = new Color(0.772549f, 0.5529412f, 1f);
|
||||
|
||||
private Color WHITE = new Color(1f, 1f, 1f);
|
||||
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
if (cyclingController.cyclingController is GameModel model)
|
||||
{
|
||||
var list = model?.mapWorkoutRecordRankings;
|
||||
if (list == null) return;
|
||||
var parent = transform.Find("ScrollView/Viewport/Content");
|
||||
|
||||
Mine.SetActive(!cyclingController.isWatch);
|
||||
RankingPanel.SetActive(cyclingController.isWatch);
|
||||
TitleImage.SetActive(!cyclingController.isWatch);
|
||||
WatchTitle.SetActive(cyclingController.isWatch);
|
||||
|
||||
if (model.FirstEndTime.HasValue)
|
||||
{
|
||||
var gap = model.FirstEndTime.Value - UIManager.Now.GetDateTime();
|
||||
var seconds = (int)Math.Floor(gap.TotalSeconds);
|
||||
CloseTime.text = Helper.FormatTicks(seconds);
|
||||
CloseTitle.gameObject.SetActive(true);
|
||||
CloseTime.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (!cyclingController.isWatch)
|
||||
{
|
||||
//当前用户排名
|
||||
var currentRanking = list.Where(c => c.UserId == cyclingController.currentPlayer.UserId).FirstOrDefault();
|
||||
if (currentRanking != null)
|
||||
{
|
||||
Utils.DisplayImage(Head, currentRanking.WxHeadImg, true);
|
||||
Ranking.text = currentRanking.Rank.ToString().PadLeft(3, '0');
|
||||
Timer.text = currentRanking.TotalTime;
|
||||
var uigradient = Mine.transform.GetComponent<UIGradient>();
|
||||
if (currentRanking.Rank <= 3)
|
||||
{
|
||||
TimerTitle.color = WHITE;
|
||||
RankingTitle.color = WHITE;
|
||||
}
|
||||
if (currentRanking.Rank == 1)
|
||||
{
|
||||
uigradient.color1 = RED;
|
||||
uigradient.color2 = SHALLOW_RED;
|
||||
Top.sprite = SpriteTop;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
if (currentRanking.Rank == 2)
|
||||
{
|
||||
uigradient.color1 = PURPLE;
|
||||
uigradient.color2 = SHALLOW_PURPLE;
|
||||
Top.sprite = SpriteSecond;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
if (currentRanking.Rank == 3)
|
||||
{
|
||||
uigradient.color1 = BLUE;
|
||||
uigradient.color2 = SHALLOW_BLUE;
|
||||
Top.sprite = SpriteThrid;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//观察者模式左边显示前三名
|
||||
var topList = list.OrderBy(c => c.Rank).Take(3);
|
||||
foreach (var item in topList)
|
||||
{
|
||||
if (item.Rank == 1)
|
||||
{
|
||||
Utils.DisplayImage(TopHead, item.WxHeadImg, true);
|
||||
var name = TopHead.transform.Find("Name").GetComponent<Text>();
|
||||
name.text = item.NickName;
|
||||
TopHead.gameObject.SetActive(true);
|
||||
}
|
||||
if (item.Rank == 2)
|
||||
{
|
||||
Utils.DisplayImage(SecondHead, item.WxHeadImg, true);
|
||||
var name = SecondHead.transform.Find("Name").GetComponent<Text>();
|
||||
name.text = item.NickName;
|
||||
SecondHead.gameObject.SetActive(true);
|
||||
}
|
||||
if (item.Rank == 3)
|
||||
{
|
||||
Utils.DisplayImage(ThirdHead, item.WxHeadImg, true);
|
||||
var name = ThirdHead.transform.Find("Name").GetComponent<Text>();
|
||||
name.text = item.NickName;
|
||||
ThirdHead.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//排名列表
|
||||
var rankingList = FindObjectsOfType<FinalRankingItemScript>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
var finalRankingItemScript = rankingList.Where(c => c.UserId == item.UserId).FirstOrDefault();
|
||||
//没有就创建
|
||||
if (finalRankingItemScript == null)
|
||||
{
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
var finalRankingItem = Instantiate(Resources.Load<GameObject>("UI/Prefab/Match/Mobile/FinalRankingItem"), parent);
|
||||
#else
|
||||
var finalRankingItem = Instantiate(Resources.Load<GameObject>("UI/Prefab/Match/FinalRankingItem"), parent);
|
||||
#endif
|
||||
finalRankingItemScript = finalRankingItem.GetComponent<FinalRankingItemScript>();
|
||||
}
|
||||
|
||||
//有就更新
|
||||
finalRankingItemScript.setGap(item.Gap);
|
||||
finalRankingItemScript.setSource(item.Source);
|
||||
finalRankingItemScript.setUserId(item.UserId, item.WxHeadImg);
|
||||
finalRankingItemScript.setRanking(item.Rank);
|
||||
finalRankingItemScript.setHeartRate(item.HeartRate);
|
||||
finalRankingItemScript.setName(item.NickName);
|
||||
finalRankingItemScript.setPower(item.Power.ToString());
|
||||
finalRankingItemScript.setRatio(item.WeightKG);
|
||||
finalRankingItemScript.setTimer(item.TotalTime);
|
||||
finalRankingItemScript.transform.SetSiblingIndex(item.Rank);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Close(BaseEventData baseEventData)
|
||||
{
|
||||
this.gameObject.SetActive(false);
|
||||
this.Destroy();
|
||||
SceneManager.LoadScene("MainScene");
|
||||
//App.MainSceneParam["Name"] = "RaceHomePanel";
|
||||
}
|
||||
|
||||
private void OpenShare(BaseEventData baseEventData)
|
||||
{
|
||||
((RectTransform)ToolBarPanel.transform).pivot = new Vector2(0, ((RectTransform)ToolBarPanel.transform).pivot.y);
|
||||
ShareButton.SetActive(false);
|
||||
ToolBarPanel.transform.DOScaleX(1, 1);
|
||||
}
|
||||
|
||||
private void ShareWechat(BaseEventData baseEventData)
|
||||
{
|
||||
if (!App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.Title, "By " + App.CurrentUser.Nickname, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.Title, "By " + App.CurrentUser.Nickname, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, "未安装微信");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 180198074f4b2344d8fd96e8e068324b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,15 +6,15 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using Facebook.Unity;
|
||||
using Assets.Scripts.Scenes.VideoRide;
|
||||
using Assets.Scenes.Ride.Scripts;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
namespace Assets.Scripts.Scenes.Scripts
|
||||
{
|
||||
public class GameRoomResultScript : MonoBehaviour
|
||||
{
|
||||
CyclingController cyclingController;
|
||||
VideoGameManager cyclingController;
|
||||
RawImage Head;
|
||||
Text Ranking;
|
||||
Text Timer;
|
||||
@@ -26,8 +26,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
GameObject ToolBarPanel { get; set; }
|
||||
GameObject WeChatButton { get; set; }
|
||||
GameObject WeChatGpButton { get; set; }
|
||||
|
||||
|
||||
RawImage TopHead { get; set; }
|
||||
RawImage SecondHead { get; set; }
|
||||
RawImage ThirdHead { get; set; }
|
||||
@@ -35,14 +33,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Sprite SpriteTop { get; set; }
|
||||
Sprite SpriteSecond { get; set; }
|
||||
Sprite SpriteThrid { get; set; }
|
||||
|
||||
Text RankingTitle { get; set; }
|
||||
Text TimerTitle { get; set; }
|
||||
Text CloseTime { get; set; }
|
||||
Text CloseTitle { get; set; }
|
||||
private void Awake()
|
||||
{
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
cyclingController = FindObjectOfType<VideoGameManager>();
|
||||
var closeBtn = transform.Find("Close").gameObject;
|
||||
Head = transform.Find("Mine/Head").GetComponent<RawImage>();
|
||||
Ranking = transform.Find("Mine/Ranking").GetComponent<Text>();
|
||||
@@ -76,20 +73,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
UIManager.AddEvent(closeBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Close);
|
||||
}
|
||||
|
||||
|
||||
float time = 1;
|
||||
private void Update()
|
||||
{
|
||||
//var model = cyclingController.cyclingController as GameModel;
|
||||
//if (model != null)
|
||||
//{
|
||||
///var s = model.EndCountDown();
|
||||
//显示关门时间
|
||||
//var isshow = s.Item3 && s.Item1 >= 0 && !cyclingController.isWatch;
|
||||
//CloseTime.text = Helper.FormatTicks(s.Item1);
|
||||
//CloseTitle.gameObject.SetActive(isshow);
|
||||
//CloseTime.gameObject.SetActive(isshow);
|
||||
//}
|
||||
time -= Time.deltaTime;
|
||||
while (time < 0)
|
||||
{
|
||||
@@ -118,10 +104,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (list == null) return;
|
||||
var parent = transform.Find("ScrollView/Viewport/Content");
|
||||
|
||||
Mine.SetActive(!cyclingController.isWatch);
|
||||
RankingPanel.SetActive(cyclingController.isWatch);
|
||||
TitleImage.SetActive(!cyclingController.isWatch);
|
||||
WatchTitle.SetActive(cyclingController.isWatch);
|
||||
Mine.SetActive(true);
|
||||
RankingPanel.SetActive(false);
|
||||
TitleImage.SetActive(true);
|
||||
WatchTitle.SetActive(false);
|
||||
|
||||
if (model.FirstEndTime.HasValue)
|
||||
{
|
||||
@@ -132,74 +118,41 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
CloseTime.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (!cyclingController.isWatch)
|
||||
//当前用户排名
|
||||
var currentRanking = list.Where(c => c.UserId == cyclingController.CurrentPlayer.UserId).FirstOrDefault();
|
||||
if (currentRanking != null)
|
||||
{
|
||||
//当前用户排名
|
||||
var currentRanking = list.Where(c => c.UserId == cyclingController.currentPlayer.UserId).FirstOrDefault();
|
||||
if (currentRanking != null)
|
||||
Utils.DisplayImage(Head, currentRanking.WxHeadImg, true);
|
||||
Ranking.text = currentRanking.Rank.ToString().PadLeft(3, '0');
|
||||
Timer.text = currentRanking.TotalTime;
|
||||
var uigradient = Mine.transform.GetComponent<UIGradient>();
|
||||
if (currentRanking.Rank <= 3)
|
||||
{
|
||||
Utils.DisplayImage(Head, currentRanking.WxHeadImg, true);
|
||||
Ranking.text = currentRanking.Rank.ToString().PadLeft(3, '0');
|
||||
Timer.text = currentRanking.TotalTime;
|
||||
var uigradient = Mine.transform.GetComponent<UIGradient>();
|
||||
if (currentRanking.Rank <= 3)
|
||||
{
|
||||
TimerTitle.color = WHITE;
|
||||
RankingTitle.color = WHITE;
|
||||
}
|
||||
if (currentRanking.Rank == 1)
|
||||
{
|
||||
uigradient.color1 = RED;
|
||||
uigradient.color2 = SHALLOW_RED;
|
||||
Top.sprite = SpriteTop;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
if (currentRanking.Rank == 2)
|
||||
{
|
||||
uigradient.color1 = PURPLE;
|
||||
uigradient.color2 = SHALLOW_PURPLE;
|
||||
Top.sprite = SpriteSecond;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
if (currentRanking.Rank == 3)
|
||||
{
|
||||
uigradient.color1 = BLUE;
|
||||
uigradient.color2 = SHALLOW_BLUE;
|
||||
Top.sprite = SpriteThrid;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
TimerTitle.color = WHITE;
|
||||
RankingTitle.color = WHITE;
|
||||
}
|
||||
if (currentRanking.Rank == 1)
|
||||
{
|
||||
uigradient.color1 = RED;
|
||||
uigradient.color2 = SHALLOW_RED;
|
||||
Top.sprite = SpriteTop;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
if (currentRanking.Rank == 2)
|
||||
{
|
||||
uigradient.color1 = PURPLE;
|
||||
uigradient.color2 = SHALLOW_PURPLE;
|
||||
Top.sprite = SpriteSecond;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
if (currentRanking.Rank == 3)
|
||||
{
|
||||
uigradient.color1 = BLUE;
|
||||
uigradient.color2 = SHALLOW_BLUE;
|
||||
Top.sprite = SpriteThrid;
|
||||
Top.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//观察者模式左边显示前三名
|
||||
var topList = list.OrderBy(c => c.Rank).Take(3);
|
||||
foreach (var item in topList)
|
||||
{
|
||||
if (item.Rank == 1)
|
||||
{
|
||||
Utils.DisplayImage(TopHead, item.WxHeadImg, true);
|
||||
var name = TopHead.transform.Find("Name").GetComponent<Text>();
|
||||
name.text = item.NickName;
|
||||
TopHead.gameObject.SetActive(true);
|
||||
}
|
||||
if (item.Rank == 2)
|
||||
{
|
||||
Utils.DisplayImage(SecondHead, item.WxHeadImg, true);
|
||||
var name = SecondHead.transform.Find("Name").GetComponent<Text>();
|
||||
name.text = item.NickName;
|
||||
SecondHead.gameObject.SetActive(true);
|
||||
}
|
||||
if (item.Rank == 3)
|
||||
{
|
||||
Utils.DisplayImage(ThirdHead, item.WxHeadImg, true);
|
||||
var name = ThirdHead.transform.Find("Name").GetComponent<Text>();
|
||||
name.text = item.NickName;
|
||||
ThirdHead.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//排名列表
|
||||
var rankingList = FindObjectsOfType<FinalRankingItemScript>();
|
||||
@@ -219,7 +172,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
//有就更新
|
||||
finalRankingItemScript.setGap(item.Gap);
|
||||
//finalRankingItemScript.setSource(item.de);
|
||||
finalRankingItemScript.setSource(item.Source);
|
||||
finalRankingItemScript.setUserId(item.UserId, item.WxHeadImg);
|
||||
finalRankingItemScript.setRanking(item.Rank);
|
||||
finalRankingItemScript.setHeartRate(item.HeartRate);
|
||||
@@ -237,46 +190,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
this.gameObject.SetActive(false);
|
||||
this.Destroy();
|
||||
SceneManager.LoadScene("MainScene");
|
||||
//App.MainSceneParam["Name"] = "RaceHomePanel";
|
||||
}
|
||||
|
||||
private void OpenShare(BaseEventData baseEventData)
|
||||
{
|
||||
((RectTransform)ToolBarPanel.transform).pivot = new Vector2(0, ((RectTransform)ToolBarPanel.transform).pivot.y);
|
||||
ShareButton.SetActive(false);
|
||||
ToolBarPanel.transform.DOScaleX(1, 1);
|
||||
}
|
||||
|
||||
private void ShareWechat(BaseEventData baseEventData)
|
||||
{
|
||||
if (!App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.Title, "By " + App.CurrentUser.Nickname, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.Title, "By " + App.CurrentUser.Nickname, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, "未安装微信");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 180198074f4b2344d8fd96e8e068324b
|
||||
guid: 1fbc05c763a9da04c9a30c0eb2e41cd6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Reference in new issue
Block a user