对战与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
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
}
|
||||
else
|
||||
{
|
||||
MapUDPService.Send(route.RouteInstance.Id, recorderData.BelongUserId, route.Point.First().Reverse().ToArray(), competitionId: recorderData.Competitionid);
|
||||
MapUDPService.Send(route.RouteInstance.Id, recorderData.BelongUserId, route.Point.First().Reverse().ToArray(), competitionId: recorderData.Competitionid,roomId: recorderData.RoomId);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
public int? FirstUserId { get; private set; }
|
||||
public GameRoomModel GameRoom { get; private set; }
|
||||
public List<RoomRankItem> mapWorkoutRecordRankings = new List<RoomRankItem>();
|
||||
|
||||
public List<CompetitionResultModel> gameRoomResult;//new List<CompetitionResultModel>();
|
||||
public GameModel(Route route,RouteResultParam param)
|
||||
: base(route, CyclingModel.Single)
|
||||
{
|
||||
@@ -125,7 +125,7 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
}
|
||||
|
||||
#region 骑行结束,比赛结果展示数据
|
||||
var results = new List<CompetitionResultModel>();
|
||||
gameRoomResult = new List<CompetitionResultModel>();
|
||||
if (recorderData.IsCompleted || recorderData.Saved)
|
||||
{
|
||||
var users1 = userList.Where(d => d.IsCompleted || d.Saved);
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected double totalClimb;
|
||||
|
||||
public double TotalClimb { get => totalClimb; }
|
||||
public int UserId { set; get; }//{ get => userId; }
|
||||
public int UserId { set; get; }
|
||||
public double Speed { get => speed; }
|
||||
public double Power { get => power; }
|
||||
public double Cadance { get => cadance; }
|
||||
@@ -90,9 +90,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#endregion
|
||||
void Start()
|
||||
{
|
||||
|
||||
Init();
|
||||
//StartCoroutine("TestExcute");
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -117,10 +115,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
|
||||
mapData = mainController.GetMapData();//获取路书信息
|
||||
|
||||
////获取海拔图UI对象
|
||||
//var graphObject = transform.parent.Find("UI/Panel/GraphChart");
|
||||
//chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||
//graph = graphObject.GetComponent<GraphChartBase>();
|
||||
chartDataSourceScript = mainController.chartDataSourceScript;
|
||||
graph = mainController.graph;
|
||||
cyclingExcutor = mainController.cyclingController;
|
||||
@@ -153,32 +147,29 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//人物动画控制
|
||||
if (characterAnimator != null)
|
||||
{
|
||||
//characterAnimator.SetFloat("Speed", (float)speed);
|
||||
//characterAnimator.SetFloat("Slope", (float)currentSlope);
|
||||
if (characterAnimator != null)
|
||||
{
|
||||
//characterAnimator.SetFloat("preSpeed", (float)preSpeed);
|
||||
characterAnimator.SetFloat("speed", (float)speed);
|
||||
characterAnimator.SetFloat("grade", (float)currentSlope);
|
||||
characterAnimator.SetFloat("power", (float)power);
|
||||
}
|
||||
//if (currentSlope > 6)
|
||||
// {
|
||||
// characterAnimator.speed = 0.45f;
|
||||
//}
|
||||
// else
|
||||
// {
|
||||
// characterAnimator.speed = 0.65f;
|
||||
//}
|
||||
//if (speed > 40)
|
||||
//{
|
||||
// characterAnimator.speed = 0.75f;
|
||||
//}
|
||||
|
||||
//if (totalDistance >= mapData.TotalDistance)
|
||||
//{
|
||||
// characterAnimator.SetBool("ReachEnd", true);//到达终点
|
||||
//}
|
||||
//根据速度和坡度不同分为4个等级的播放速度
|
||||
if (speed > 20)
|
||||
{
|
||||
characterAnimator.speed = 1.15f;
|
||||
}
|
||||
else if (speed > 35)
|
||||
{
|
||||
characterAnimator.speed = 1.25f;
|
||||
}
|
||||
else if (speed > 45)
|
||||
{
|
||||
characterAnimator.speed = 1.45f;
|
||||
}
|
||||
else if (currentSlope > 4.5)
|
||||
{
|
||||
characterAnimator.speed = 0.5f;
|
||||
}
|
||||
}
|
||||
Compute();//接受蓝牙设备数据计算
|
||||
//开始骑行
|
||||
|
||||
@@ -224,6 +224,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
protected virtual void Cancel(BaseEventData baseEvent)
|
||||
{
|
||||
//如果在对战房间内,发送退出房间的命令
|
||||
if (cyclingController.roomId > 0)
|
||||
{
|
||||
MapUDPService.SendGameRoomKick(cyclingController.roomId, App.CurrentUser.Id, App.CurrentUser.Id);
|
||||
}
|
||||
SceneManager.LoadScene("MainScene");
|
||||
}
|
||||
protected IEnumerator HiddenLoading()
|
||||
@@ -234,6 +239,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
private bool tileHeightProcessed = false;
|
||||
protected void _map_OnInitialized()
|
||||
{
|
||||
panel.transform.Find("Multips")?.gameObject.SetActive(true);
|
||||
var visualizer = _map.MapVisualizer;
|
||||
visualizer.OnTileHeightProcessingFinished += (s) =>
|
||||
{
|
||||
|
||||
@@ -298,7 +298,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
mainController = FindObjectOfType<CyclingController>();
|
||||
player = transform.parent.Find("Player");
|
||||
player = playerController.transform;
|
||||
var route = mainController.GetRoute();
|
||||
uipanel = mainController.GetUIPanel();
|
||||
InitGameObject();
|
||||
@@ -384,7 +384,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (target != null && mainController.Is3dView && mainController.RotateLock && mainController.currentPlayer.Speed > 0)
|
||||
{
|
||||
Vector3 v = Vector3.zero;
|
||||
v.y += mainController.currentPlayer.currentRotation.eulerAngles.y + 160f;
|
||||
v.y += mainController.currentPlayer.currentRotation.eulerAngles.y-20f; //+ 160f;
|
||||
if (mainController.RotateLock)
|
||||
{
|
||||
target.transform.DOLocalRotate(v, 1f, RotateMode.Fast);
|
||||
@@ -399,7 +399,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (!mainController.Is3dView)
|
||||
{
|
||||
Vector3 v = Vector3.zero;
|
||||
v.y += mainController.currentPlayer.currentRotation.eulerAngles.y + 160f; //target.transform.rotation = playerController.transform.rotation;//new Quaternion(playerController.transform.rotation.x, playerController.transform.rotation.y +1f, playerController.transform.rotation.z, playerController.transform.rotation.w);
|
||||
v.y += mainController.currentPlayer.currentRotation.eulerAngles.y-20f;// + 160f; //target.transform.rotation = playerController.transform.rotation;//new Quaternion(playerController.transform.rotation.x, playerController.transform.rotation.y +1f, playerController.transform.rotation.z, playerController.transform.rotation.w);
|
||||
target.transform.eulerAngles = v; //.Set(0, playerController.currentRotation.eulerAngles.y + 160f, 0);// = new Vector3(0, playerController.transform.eulerAngles.y + 160f, 0);
|
||||
//mainController.player.transform.localScale.Set(0.1f, 0.1f, 0.1f);
|
||||
player.transform.localScale = m;
|
||||
@@ -519,15 +519,25 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
else
|
||||
{
|
||||
SendQuit4GameRoom();
|
||||
SceneManager.LoadScene("MainScene");
|
||||
}
|
||||
}
|
||||
private void SendQuit4GameRoom()
|
||||
{
|
||||
//如果在对战房间内,发送退出房间的命令
|
||||
if (mainController.roomId > 0)
|
||||
{
|
||||
MapUDPService.SendGameRoomKick(mainController.roomId, App.CurrentUser.Id, App.CurrentUser.Id);
|
||||
}
|
||||
}
|
||||
//不保存退出
|
||||
public virtual void CancelQuit(BaseEventData baseEventData)
|
||||
{
|
||||
modalPanel.SetActive(false);
|
||||
quitPanel.SetActive(false);
|
||||
mainController.ClearTempFile();
|
||||
SendQuit4GameRoom();
|
||||
SceneManager.LoadScene("MainScene");
|
||||
}
|
||||
//取消退出
|
||||
@@ -546,6 +556,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
protected virtual void StopShortRide(BaseEventData baseEventData)
|
||||
{
|
||||
//发送退出房间的命令
|
||||
SendQuit4GameRoom();
|
||||
SceneManager.LoadScene("MainScene");
|
||||
}
|
||||
protected virtual void CancelStopShortRide(BaseEventData baseEventData)
|
||||
|
||||
@@ -29,7 +29,7 @@ using System.Timers;
|
||||
public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
public AbstractMap map;
|
||||
public GameObject player;
|
||||
public GameObject player { get; set; }
|
||||
public GameObject UIObject;
|
||||
public RouteResultParam selectParamModel;
|
||||
public RouteResult routeResult;
|
||||
@@ -100,6 +100,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
competitionId = App.tempRecordData.CompetitionId;
|
||||
routeId = App.tempRecordData.RouteId;
|
||||
}
|
||||
CreateCurrentPlayer();
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
|
||||
@@ -219,10 +220,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
minicamera = transform.Find("MiniCamera").gameObject;
|
||||
//进入倒计时
|
||||
singleUIManager = UIObject.GetComponent<BaseUIManager>();
|
||||
TrailRenderer trail = player.GetComponent<TrailRenderer>();
|
||||
trail.Clear();
|
||||
playerController = player.GetComponent<PlayerController>();
|
||||
currentPlayer = playerController;//当前选中用户
|
||||
|
||||
|
||||
if (competitionId > 0)
|
||||
{
|
||||
@@ -761,6 +759,22 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
map.SetExtent(MapExtentType.RangeAroundTransform, options);
|
||||
map.SetExtentOptions(options);
|
||||
}
|
||||
//根据性别创建当前骑手
|
||||
private void CreateCurrentPlayer()
|
||||
{
|
||||
if (App.CurrentUser.Sex == 1)
|
||||
{
|
||||
player = Instantiate<GameObject>(Resources.Load<GameObject>("UI/Prefab/Ride/Player"),transform);
|
||||
}
|
||||
else
|
||||
{
|
||||
player = Instantiate<GameObject>(Resources.Load<GameObject>("UI/Prefab/Ride/Player_NV"), transform);
|
||||
}
|
||||
TrailRenderer trail = player.GetComponent<TrailRenderer>();
|
||||
trail.Clear();
|
||||
playerController = player.GetComponent<PlayerController>();
|
||||
currentPlayer = playerController;
|
||||
}
|
||||
|
||||
//设置骑行模式
|
||||
public void SetCyclingModel(CyclingModel mode)
|
||||
@@ -826,7 +840,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//设定人物方向
|
||||
var s = map.GeoToWorldPosition(selectedPlayer.Currentlatlong);
|
||||
var e = map.GeoToWorldPosition(nextLatLon);
|
||||
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
||||
Quaternion neededRotation = Quaternion.LookRotation(e - s);
|
||||
selectedPlayer.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
||||
selectedPlayer.currentRotation = neededRotation;
|
||||
}
|
||||
@@ -840,7 +854,6 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
private void InitPlayer()
|
||||
{
|
||||
TempFileHandler();//处理中断骑行继续骑的逻辑
|
||||
|
||||
lockView = true;
|
||||
|
||||
Vector2d lastLatLon = Along(recorderData.EndDistance);
|
||||
@@ -858,7 +871,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//设定人物方向
|
||||
var s = map.GeoToWorldPosition(lastLatLon);
|
||||
var e = map.GeoToWorldPosition(nextLatLon);
|
||||
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
||||
Quaternion neededRotation = Quaternion.LookRotation(e - s);
|
||||
player.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
||||
playerController.currentRotation = neededRotation;
|
||||
//初始化海拔图头像位置
|
||||
@@ -880,7 +893,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
public BaseUIManager singleUIManager;
|
||||
public void GameStart()
|
||||
{
|
||||
Camera.main.transform.DOLocalMove(neareast, 1f);
|
||||
Camera.main.transform.DOLocalMove(near, 1f);
|
||||
//StartCoroutine(MoveCamera(far, near));//初始摄像头
|
||||
var check = CheckAnt();
|
||||
#if UNITY_EDITOR
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
[SerializeField]
|
||||
GameObject _player;
|
||||
CyclingController cyclingCotroller;
|
||||
public PlayerController playerController;
|
||||
public PlayerController playerController { get; set; }
|
||||
GameObject _mipMapRoute;
|
||||
public RectTransform RectRoot;//rawImage
|
||||
TrailRenderer trail;
|
||||
@@ -28,12 +28,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
void Start()
|
||||
{
|
||||
cyclingCotroller = FindObjectOfType<CyclingController>();
|
||||
//playerController = FindObjectOfType<PlayerController>();
|
||||
if (cyclingCotroller != null)
|
||||
{
|
||||
var mapdata = cyclingCotroller.GetMapData();
|
||||
//初始化map
|
||||
//var point = cyclingCotroller.GetCenterCoordinate();
|
||||
if (_map != null && mapdata !=null)
|
||||
{
|
||||
_map.OnInitialized += _map_OnInitialized;
|
||||
@@ -57,10 +54,14 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
float timer = 0;
|
||||
private void Update()
|
||||
{
|
||||
if (playerController != null)
|
||||
if (playerController == null)
|
||||
{
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
}
|
||||
else
|
||||
{
|
||||
var tr = uitransform.Find("MiniMap/MiniMap/arrow");
|
||||
tr.SetSiblingIndex(9999);
|
||||
tr.SetAsLastSibling();
|
||||
var pos = _map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||
pos.y += 15f;
|
||||
_player.transform.localPosition = pos;
|
||||
@@ -105,10 +106,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
private bool init = false;
|
||||
private void _map_OnInitialized()
|
||||
{
|
||||
init = true;
|
||||
var visualizer = _map.MapVisualizer;
|
||||
visualizer.OnMapVisualizerStateChanged += (s) =>
|
||||
{
|
||||
|
||||
@@ -42,9 +42,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (App.gameRoomDetail != null)
|
||||
{
|
||||
loadingPanel = panel.transform.Find("LoadingPanel").gameObject;
|
||||
loadingPanel.showLoadingExtension();
|
||||
ShowGameRoomLoading();
|
||||
loadingPanel = panel.transform.Find("LoadingPanel").gameObject;
|
||||
loadingPanel.showLoadingExtension();
|
||||
}
|
||||
}
|
||||
private void ShowGameRoomLoading()
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
parent = scroll.transform.Find("Viewport/Content");
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
nearByItem = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/NearbyItem");
|
||||
nearByMajorItem = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/NearbyMajorItem");
|
||||
@@ -34,6 +33,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
protected override void CreateList()
|
||||
{
|
||||
if (playerController == null)
|
||||
{
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
return;
|
||||
}
|
||||
var roomId = cyclingController.cyclingController == null ? 0 : cyclingController.cyclingController.recorderData.RoomId;
|
||||
OnlineUserNum.text = " "+ MapUDPService.GetNearRiderCount(roomId).ToString();
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(OnlineUserNum.rectTransform);
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cadance = mainController.UpdateCadence();
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
#if UNITY_EDITOR
|
||||
power = 300;
|
||||
#endif
|
||||
//#if !UNITY_EDITOR
|
||||
power = 100;
|
||||
//#endif
|
||||
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -113,7 +113,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//实时计算MaxAp
|
||||
//mainController.ComputeMaxAP(Power, ticks);
|
||||
//实时保存骑行记录
|
||||
if (ticks % 60 == 0)
|
||||
if (ticks % 60 == 0 && !(mainController.cyclingController is GameModel))
|
||||
{
|
||||
mainController.SaveRealTime();
|
||||
}
|
||||
|
||||
@@ -67,15 +67,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public PlayerController playerController;
|
||||
public void Start()
|
||||
{
|
||||
cyclingCotroller = transform.parent.GetComponent<CyclingController>();
|
||||
//playerController = FindObjectOfType<PlayerController>();
|
||||
_map.OnTileFinished += _map_OnTileFinished;
|
||||
StartCoroutine(QueryTimer());
|
||||
//CreateRoute();
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
@@ -103,32 +99,21 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var mapData = cyclingCotroller.GetMapData();
|
||||
if (mapData != null && cyclingCotroller.currentPlayer != null)
|
||||
{
|
||||
//foreach (var mapDataItem in mapData.List)
|
||||
for (int i = 0; i < mapData.List.Count; i++)
|
||||
{
|
||||
var point = mapData.List[i].Point;
|
||||
Vector3 item = _map.GeoToWorldPosition(new Vector2d(point[0], point[1]));
|
||||
item.y += 1f;
|
||||
//if (!posInScreen(item) && i > playerController.CurrentIndex)
|
||||
//{
|
||||
// break;
|
||||
//}
|
||||
//else if (posInScreen(item))
|
||||
//{
|
||||
// dat.Add(item);
|
||||
//}
|
||||
//前后取50个点
|
||||
decimal diff = i - cyclingCotroller.currentPlayer.CurrentIndex;
|
||||
decimal diffAbs = Math.Abs(diff);
|
||||
if (diffAbs <= 200)
|
||||
{
|
||||
//if (!dat.Contains(item))
|
||||
dat.Add(item);
|
||||
}
|
||||
if (diff <= 0 && diff > -200)
|
||||
{
|
||||
item.y += 0.15f;
|
||||
//if (!dat.Contains(item))
|
||||
path.Add(item);
|
||||
}
|
||||
}
|
||||
@@ -208,11 +193,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
lineRender.positionCount = dat.Count;
|
||||
lineRender.SetPositions(feat.Points[0].ToArray());
|
||||
lineRender.loop = false;
|
||||
//lineRender.numCapVertices = 10;
|
||||
//lineRender.numCornerVertices = 30;
|
||||
lineRender.numCapVertices = 10;
|
||||
lineRender.numCornerVertices = 30;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CreatPathRoute(List<Vector3> feat)
|
||||
{
|
||||
@@ -236,10 +221,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
lineRender.positionCount = feat.Count;
|
||||
lineRender.SetPositions(feat.ToArray());
|
||||
lineRender.loop = false;
|
||||
//lineRender.numCapVertices = 10;
|
||||
//lineRender.numCornerVertices = 10;
|
||||
//
|
||||
lineRender.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
||||
lineRender.numCapVertices = 10;
|
||||
lineRender.numCornerVertices = 30;
|
||||
|
||||
lineRender.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
||||
lineRender.allowOcclusionWhenDynamic = false;
|
||||
lineRender.textureMode = LineTextureMode.Tile;
|
||||
lineRender.motionVectorGenerationMode = MotionVectorGenerationMode.ForceNoMotion;
|
||||
|
||||
Reference in new issue
Block a user