动画调整&新版设计稿调整
This commit is contained in:
1 parent
ec9337b446
commit
cd1d67d9e8
36 files changed
+3195
-6103
No files matched your search
@@ -1,9 +1,9 @@
|
||||
using Assets.Scenes.Ride.Scripts;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using ChartAndGraph;
|
||||
using DG.Tweening;
|
||||
using Mapbox.Utils;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -142,6 +142,10 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
animator.SetFloat("speed", (float)speed);
|
||||
animator.SetFloat("grade", (float)currentSlope);
|
||||
animator.SetFloat("power", (float)power);
|
||||
var headBack = ticks % 10 == 0 && speed > 0 && bearing == 0;
|
||||
var drink = ticks % 15 == 0 && speed > 0 && bearing == 0;
|
||||
animator.SetBool("headBack", headBack);
|
||||
animator.SetBool("drinking", drink);
|
||||
}
|
||||
}
|
||||
protected virtual int GetCurrentFrame()
|
||||
@@ -150,42 +154,45 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
}
|
||||
private bool animated = false;
|
||||
//大转弯是60度
|
||||
private int offset = 0;
|
||||
protected virtual void Turn()
|
||||
{
|
||||
var currentFrame = GetCurrentFrame();
|
||||
if (manager.mockDirection.ContainsKey((int)currentFrame))
|
||||
var result = manager.mockDirection.Where(c => c.Start < currentFrame && c.End > currentFrame).FirstOrDefault();
|
||||
if (result != null)
|
||||
{
|
||||
bearing = manager.mockDirection[(int)currentFrame];
|
||||
bearing = result.Value;
|
||||
}
|
||||
animator.SetFloat("bearing", bearing);
|
||||
|
||||
if (!animated && Math.Abs(bearing) > 30)
|
||||
if (Math.Abs(bearing) > 50)
|
||||
{
|
||||
//TODO:大拐弯动画
|
||||
animated = true;
|
||||
var current = transform.position;
|
||||
//transform.DOMove(new Vector3(current.x+5, current.y, current.z), 1f).onComplete += () =>
|
||||
//{
|
||||
// current = transform.position;
|
||||
// transform.DOMove(new Vector3(current.x-5, current.y, current.z), 1f);
|
||||
//};
|
||||
transform.DORotate(new Vector3(0, bearing, 0), 1f);
|
||||
transform.DOMoveX(current.x + 3, 2).onComplete += () =>
|
||||
if (!animated)
|
||||
{
|
||||
};
|
||||
//transform.DOMove(new Vector3(current.x + 5, current.y, current.z), 1f).onComplete += () => {
|
||||
// transform.DOMove(new Vector3(current.x - 5, current.y, current.z), 1f);
|
||||
// animated = false;
|
||||
//};
|
||||
animated = true;
|
||||
transform.DOMoveX(transform.position.x + 3, 1).onComplete += () =>
|
||||
{
|
||||
offset = -3;
|
||||
};
|
||||
print(176);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var aniInfo = animator.GetCurrentAnimatorStateInfo(0);
|
||||
if (aniInfo.loop)
|
||||
if (offset != 0)
|
||||
{
|
||||
transform.DORotate(new Vector3(0, bearing, 0), 1f);
|
||||
transform.DOMoveX(transform.position.x + offset, 1f).onComplete += () =>
|
||||
{
|
||||
animated = false;
|
||||
};
|
||||
offset = 0;
|
||||
}
|
||||
}
|
||||
transform.DORotate(new Vector3(0, bearing, 0), 1f);
|
||||
//var aniInfo = animator.GetCurrentAnimatorStateInfo(0);
|
||||
//if (aniInfo.loop)
|
||||
//{
|
||||
|
||||
//}
|
||||
}
|
||||
//计算人物当前属性
|
||||
protected virtual void ComputePlayer()
|
||||
@@ -201,7 +208,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
distance = 0;
|
||||
}
|
||||
//一旦有功率就开始骑行、否则暂停
|
||||
if (!manager.IsQuit() && manager.CurrentPlayer.UserId == UserId)
|
||||
if (!manager.IsQuit() && manager.CurrentPlayer.UserId == UserId && !manager.IsQuit())
|
||||
{
|
||||
if (power > 0)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
public class ExplosiveScript : MonoBehaviour
|
||||
{
|
||||
Image image;
|
||||
private void Awake()
|
||||
{
|
||||
image = transform.GetComponent<Image>();
|
||||
}
|
||||
float flag = 0f;
|
||||
float alph = 0f;
|
||||
private void Update()
|
||||
{
|
||||
flag += Time.deltaTime;
|
||||
if (flag >= 1f)
|
||||
{
|
||||
alph -= Time.deltaTime;
|
||||
if (alph <= 0)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
alph += Time.deltaTime;
|
||||
}
|
||||
image.color = new Color(image.color.r, image.color.g, image.color.b, alph);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a04020ffe9892d498bfe3031bac76ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -81,22 +81,15 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
var mainFrame = manager.GetCurrentFrame();
|
||||
var min = Math.Min(currentFrame, mainFrame);
|
||||
var max = Math.Max(currentFrame, mainFrame);
|
||||
for (int i = min; i < max; i++)
|
||||
{
|
||||
if (manager.mockDirection.ContainsKey(currentFrame))
|
||||
{
|
||||
bearing = manager.mockDirection[currentFrame];
|
||||
}
|
||||
animator.SetFloat("bearing", bearing);
|
||||
}
|
||||
var result = manager.mockDirection.Where(c => c.Start < currentFrame && c.End > currentFrame).FirstOrDefault();
|
||||
bearing = result?.Value ?? 0;
|
||||
animator.SetFloat("bearing", bearing);
|
||||
}
|
||||
else
|
||||
{
|
||||
var mainFrame = manager.GetCurrentFrame();
|
||||
if (manager.mockDirection.ContainsKey(mainFrame))
|
||||
{
|
||||
bearing = manager.mockDirection[mainFrame];
|
||||
}
|
||||
var result = manager.mockDirection.Where(c => c.Start < mainFrame && c.End > mainFrame).FirstOrDefault();
|
||||
bearing = result?.Value ?? 0;
|
||||
animator.SetFloat("bearing", bearing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using Assets.Scripts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
public class RankingItemScript:MonoBehaviour
|
||||
{
|
||||
Text rankingText;
|
||||
Text nameText;
|
||||
Text timerText;
|
||||
|
||||
RawImage head;
|
||||
RawImage country;
|
||||
private void Awake()
|
||||
{
|
||||
rankingText = transform.Find("Rank").GetComponent<Text>();
|
||||
nameText = transform.Find("Name").GetComponent<Text>();
|
||||
timerText = transform.Find("Distance").GetComponent<Text>();
|
||||
// head = transform.Find("Head").GetComponent<RawImage>();
|
||||
country = transform.Find("Country").GetComponent<RawImage>();
|
||||
}
|
||||
|
||||
public void SetRanking(string ranking)
|
||||
{
|
||||
rankingText.text = ranking.PadLeft(2,'0');
|
||||
}
|
||||
public void SetName(string name)
|
||||
{
|
||||
nameText.text = name;
|
||||
}
|
||||
public void SetTimer(string timer)
|
||||
{
|
||||
timerText.text = timer;
|
||||
}
|
||||
public void SetHead(string url)
|
||||
{
|
||||
Utils.DisplayImage(head, url);
|
||||
}
|
||||
public void SetCountry(Texture texture)
|
||||
{
|
||||
country.texture = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8032c539f5d80584da36ae53a0f52e1a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -13,12 +13,33 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
GameObject Hide { get; set; }
|
||||
GameObject Show { get; set; }
|
||||
VideoGameManager manager { get; set; }
|
||||
private void Start()
|
||||
{
|
||||
Hide = transform.Find("Head/Hide").gameObject;
|
||||
Show = transform.Find("Head/Show").gameObject;
|
||||
manager = FindObjectOfType<VideoGameManager>();
|
||||
UIManager.AddEvent(Hide, UnityEngine.EventSystems.EventTriggerType.PointerClick, Hidehandler);
|
||||
UIManager.AddEvent(Show, UnityEngine.EventSystems.EventTriggerType.PointerClick, Showhandler);
|
||||
Init();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
var list = manager.GetRankingList();
|
||||
if (list != null)
|
||||
{
|
||||
var prefab = Resources.Load<GameObject>("UI/Prefab/AR/RankingItem");
|
||||
foreach (var item in list.list)
|
||||
{
|
||||
GameObject newObj = (GameObject)Instantiate(prefab, transform.Find("List/Viewport/Content"));
|
||||
var itemScript = newObj.GetComponent<RankingItemScript>();
|
||||
itemScript.SetName(item.NickName);
|
||||
var texture = manager.GetCountryImageByCode(item.CountryCode);
|
||||
itemScript.SetCountry(texture);
|
||||
itemScript.SetTimer(item.TotalTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Hidehandler(BaseEventData data)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class ShakeCamera : MonoBehaviour
|
||||
{
|
||||
|
||||
// 震动标志位
|
||||
private bool isshakeCamera = true;
|
||||
|
||||
// 震动幅度
|
||||
public float shakeLevel = 3f;
|
||||
// 震动时间
|
||||
public float setShakeTime = 0.2f;
|
||||
// 震动的FPS
|
||||
public float shakeFps = 45f;
|
||||
|
||||
private float fps;
|
||||
private float shakeTime = 0.0f;
|
||||
private float frameTime = 0.0f;
|
||||
private float shakeDelta = 0.005f;
|
||||
private Camera selfCamera;
|
||||
|
||||
private Rect changeRect;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
selfCamera = Camera.main;
|
||||
changeRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
shakeTime = setShakeTime;
|
||||
fps = shakeFps;
|
||||
frameTime = 0.03f;
|
||||
shakeDelta = 0.005f;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (isshakeCamera)
|
||||
{
|
||||
if (shakeTime > 0)
|
||||
{
|
||||
shakeTime -= Time.deltaTime;
|
||||
if (shakeTime <= 0)
|
||||
{
|
||||
changeRect.xMin = 0.0f;
|
||||
changeRect.yMin = 0.0f;
|
||||
selfCamera.rect = changeRect;
|
||||
isshakeCamera = false;
|
||||
shakeTime = setShakeTime;
|
||||
fps = shakeFps;
|
||||
frameTime = 0.03f;
|
||||
shakeDelta = 0.005f;
|
||||
}
|
||||
else
|
||||
{
|
||||
frameTime += Time.deltaTime;
|
||||
|
||||
if (frameTime > 1.0 / fps)
|
||||
{
|
||||
frameTime = 0;
|
||||
changeRect.xMin = shakeDelta * (-1.0f + shakeLevel * Random.value);
|
||||
changeRect.yMin = shakeDelta * (-1.0f + shakeLevel * Random.value);
|
||||
selfCamera.rect = changeRect;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void shake()
|
||||
{
|
||||
isshakeCamera = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68972f1ed725ed94bb600236ab29a6d3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -20,6 +20,12 @@ using UnityEngine.Events;
|
||||
|
||||
namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
public class CustomRange
|
||||
{
|
||||
public int Start { get; set; }
|
||||
public int End { get; set; }
|
||||
public int Value { get; set; }
|
||||
}
|
||||
public class VideoGameManager : DeviceServiceMonoBase
|
||||
{
|
||||
[SerializeField]
|
||||
@@ -36,7 +42,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
public DateTime startTime { get; set; }
|
||||
public CyclingModel cyclingModel;
|
||||
public BaseCycling cyclingController;
|
||||
public Dictionary<int, int> mockDirection = new Dictionary<int, int>();
|
||||
public List<CustomRange> mockDirection = new List<CustomRange>();
|
||||
private double endDistance { get; set; }
|
||||
public List<float> slots = new List<float>();
|
||||
GameObject infoPanel;
|
||||
@@ -98,6 +104,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
endDistance = 0;
|
||||
//倒计时5s开始
|
||||
SetCyclingModel(CyclingModel.Single);
|
||||
|
||||
}
|
||||
// Update is called once per frame
|
||||
float timer = 1f;
|
||||
@@ -119,6 +126,18 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
timer += 1f;
|
||||
}
|
||||
}
|
||||
MapRouteRankingList rankingList;
|
||||
public MapRouteRankingList GetRankingList()
|
||||
{
|
||||
if (rankingList != null)
|
||||
return rankingList;
|
||||
var list = ConfigHelper.mapApi.GetRouteRanking(App.RouteIdParam, "1", 0, 10, "");
|
||||
if (list.result)
|
||||
{
|
||||
rankingList = list.data;
|
||||
}
|
||||
return rankingList;
|
||||
}
|
||||
|
||||
//创建当前线路其他选手
|
||||
private void CreateOnlineUser(List<BaseRider> list)
|
||||
@@ -191,6 +210,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
videoPlayer?.gameObject.SetActive(true);
|
||||
CurrentPlayer = videoPlayer;
|
||||
ContinueAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,34 +271,21 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
return infoPanel;
|
||||
}
|
||||
//骑行记录
|
||||
public async Task ContinueAsync()
|
||||
public void ContinueAsync()
|
||||
{
|
||||
//继续骑行数据
|
||||
var r = await ConfigHelper.mapInterruptRecordApi.GetMapInterruptRecord("重庆", 0, 20, "routes");
|
||||
if (r.result)
|
||||
//骑行结果
|
||||
if (App.routeResult != null)
|
||||
{
|
||||
var first = r.data.FirstOrDefault();
|
||||
RouteResult routeResult = first.ToObject<RouteResult>();
|
||||
if (routeResult.ContinueCyclingParam != null)
|
||||
{
|
||||
App.RouteIdParam = routeResult.RouteId;
|
||||
App.routeResult = routeResult;
|
||||
//骑行结果
|
||||
if (App.routeResult != null)
|
||||
{
|
||||
routeResult = App.routeResult;
|
||||
selectParamModel = App.routeResult.ContinueCyclingParam;//继续骑行
|
||||
SetCyclingModel(CyclingModel.Single);
|
||||
endDistance = routeResult.EndDistance;
|
||||
var ratio = endDistance / routeResult.TotalDistance;
|
||||
var frame = Math.Round(ratio * mediaPlayer.Info.GetMaxFrameNumber());
|
||||
SetCurrentFrame(routeResult.LastFrame ?? 0);
|
||||
var v = FindObjectOfType<VideoPlayer>();
|
||||
v.SetEndDistance(endDistance);
|
||||
}
|
||||
}
|
||||
routeResult = App.routeResult;
|
||||
selectParamModel = App.routeResult.ContinueCyclingParam;//继续骑行
|
||||
SetCyclingModel(CyclingModel.Single);
|
||||
endDistance = routeResult.EndDistance;
|
||||
SetCurrentFrame(routeResult.LastFrame ?? 0);
|
||||
var v = FindObjectOfType<VideoPlayer>();
|
||||
v.SetEndDistance(endDistance);
|
||||
}
|
||||
}
|
||||
|
||||
private void MockDirection()
|
||||
{
|
||||
var text = Resources.Load<TextAsset>("UI/direction");
|
||||
@@ -287,7 +294,13 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
if (string.IsNullOrEmpty(item))
|
||||
continue;
|
||||
mockDirection.Add(Convert.ToInt32(item.Split(':')[0]), Convert.ToInt32(item.Split(':')[1]));
|
||||
var result = item.Split(':');
|
||||
var range = result[0].Split('~');
|
||||
mockDirection.Add(new CustomRange() {
|
||||
Start = Convert.ToInt32(range[0]),
|
||||
End = Convert.ToInt32(range[1]),
|
||||
Value = Convert.ToInt32(result[1]),
|
||||
});
|
||||
}
|
||||
}
|
||||
//设置骑行模式
|
||||
@@ -356,8 +369,16 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
//暂停
|
||||
public void Pause()
|
||||
{
|
||||
isStart = false;
|
||||
mediaPlayer?.Pause();
|
||||
isStart = !isStart;
|
||||
isStop = !isStop;
|
||||
if (isStop)
|
||||
{
|
||||
mediaPlayer?.Pause();
|
||||
}
|
||||
else
|
||||
{
|
||||
mediaPlayer?.Play();
|
||||
}
|
||||
}
|
||||
//退出骑行
|
||||
public void Quit()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.Scenes.VideoRide
|
||||
@@ -36,11 +37,10 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
protected override void ComputeAnimator()
|
||||
{
|
||||
base.ComputeAnimator();
|
||||
var currentFrame = manager.GetCurrentFrame();
|
||||
if (manager.mockDirection.ContainsKey(currentFrame))
|
||||
{
|
||||
bearing = manager.mockDirection[currentFrame];
|
||||
}
|
||||
|
||||
var mainFrame = manager.GetCurrentFrame();
|
||||
var result = manager.mockDirection.Where(c => c.Start < mainFrame && c.End > mainFrame).FirstOrDefault();
|
||||
bearing = result?.Value ?? 0;
|
||||
animator.SetFloat("bearing", bearing);
|
||||
}
|
||||
protected override void ComputePlayer()
|
||||
@@ -48,11 +48,11 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
heartRate = manager.UpDateHeart();
|
||||
power = manager.UpdatePower();
|
||||
cadance = manager.UpdateCadence();
|
||||
#region TEST
|
||||
//power = 200;
|
||||
#if UNITY_EDITOR
|
||||
power = 1200;
|
||||
cadance = 150;
|
||||
heartRate = 160;
|
||||
#endregion
|
||||
#endif
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
wkg = Math.Round(power / weight, 2);
|
||||
|
||||
@@ -61,7 +61,6 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
{
|
||||
UIManager.SetModalPanel(transform.Find("ModalPanel").GetComponent<PFUIPanel>());
|
||||
manager = FindObjectOfType<VideoGameManager>();
|
||||
button = transform.Find("Panel/Button").gameObject;
|
||||
Init();
|
||||
}
|
||||
// Update is called once per frame
|
||||
@@ -70,7 +69,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
if (manager != null)
|
||||
{
|
||||
mapName.text = manager.GetMapRoute().Name;
|
||||
//infoText.text = $"帧数:{manager.GetCurrentFrame()}";
|
||||
infoText.text = $"帧数:{manager.GetCurrentFrame()}";
|
||||
if (manager.CurrentPlayer != null)
|
||||
{
|
||||
power.text = Math.Round(manager.CurrentPlayer.power).ToString();
|
||||
@@ -85,6 +84,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
//ftp
|
||||
ftpImage.fillAmount = (float)(manager.CurrentPlayer.wkg / MAXWKG);
|
||||
wkg.text = $"{manager.CurrentPlayer.wkg}w/kg";
|
||||
explosive.SetActive(manager.CurrentPlayer.power > 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,8 +104,10 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
}
|
||||
GameObject ComputerPanel { get; set; }
|
||||
GameObject WatchPanel { get; set; }
|
||||
GameObject explosive { get; set; }
|
||||
private void Init()
|
||||
{
|
||||
infoText = transform.Find("InfoText").GetComponentInChildren<Text>();
|
||||
ComputerPanel = transform.Find("Panel/ComputerPanel").gameObject;
|
||||
WatchPanel = transform.Find("Panel/WatchPanel").gameObject;
|
||||
power = transform.Find("Panel/ComputerPanel/Power").GetComponent<Text>();
|
||||
@@ -133,6 +135,8 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
//modal
|
||||
settingPanel = transform.Find("Panel/SettingPanel").gameObject;
|
||||
resultPanel = transform.Find("Panel/ResultPanel").gameObject;
|
||||
//
|
||||
explosive = transform.Find("Panel/Explosive").gameObject;
|
||||
//toolbar 事件注册
|
||||
UIManager.AddEvent(pauseBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, PauseClick);
|
||||
UIManager.AddEvent(changeViewBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, ChangeViewClick);
|
||||
@@ -191,6 +195,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
var rankingScript = FindObjectOfType<RankingScript>();
|
||||
var currentPlayer = manager.CurrentPlayer == null ? videoPlayer.transform : manager.CurrentPlayer.transform;
|
||||
_viewMode = _viewMode == ViewMode.THIRD ? ViewMode.FIRST : ViewMode.THIRD;
|
||||
var cameraImage = changeViewBtn.transform.Find("Camera").gameObject;
|
||||
if (_viewMode == ViewMode.FIRST)
|
||||
{
|
||||
currentPlayer.DOMoveZ(-0.1f, 0f);
|
||||
@@ -198,6 +203,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
ftpPanel.SetActive(true);
|
||||
nearByScript.Hidehandler(null);
|
||||
rankingScript.Hidehandler(null);
|
||||
cameraImage.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -206,6 +212,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
currentPlayer.DOMoveY(-1f, 0f);
|
||||
nearByScript.Showhandler(null);
|
||||
rankingScript.Showhandler(null);
|
||||
cameraImage.SetActive(false);
|
||||
}
|
||||
}
|
||||
private void QuitClick(BaseEventData e)
|
||||
@@ -216,6 +223,7 @@ namespace Assets.Scripts.Scenes.VideoRide
|
||||
UIManager.ShowConfirm("Quit", "Do you want to keep the record?",
|
||||
() =>
|
||||
{
|
||||
videoPlayer = FindObjectOfType<VideoPlayer>();
|
||||
videoPlayer?.Upload();
|
||||
UIManager.CloseConfirm();
|
||||
//show result
|
||||
|
||||
Reference in new issue
Block a user