骑行界面优化&PCtips显示调整
This commit is contained in:
1 parent
d91dc17ea7
commit
2743c8d185
23 files changed
+1368
-769
No files matched your search
@@ -315,7 +315,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (mainController.mapRouteRankingList == null || mainController.mapRouteRankingList.Count == 0)
|
||||
{
|
||||
var lang = App.GetLocalLanguage();
|
||||
shadowButton.image.sprite = lang == "zh"? Resources.Load<Sprite>("Images/Ride/Shadow Mode_no"): Resources.Load<Sprite>("Images/Ride/Shadow Mode_no");
|
||||
shadowButton.image.sprite = lang == "zh"? Resources.Load<Sprite>("Images/Ride/Shadow Mode_PC_d") : Resources.Load<Sprite>("Images/Ride/Shadow Mode_no");
|
||||
shadowButton.enabled = false;
|
||||
shadowButton.interactable = false;
|
||||
}
|
||||
|
||||
@@ -294,28 +294,28 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
};
|
||||
|
||||
TouchKit.addGestureRecognizer(rotationRecognizer);
|
||||
//单指
|
||||
var touchRecognizer = new TKAnyTouchRecognizer(new TKRect(0, 0, Screen.width, Screen.height));
|
||||
DateTime startTimpStamp = DateTime.Now;
|
||||
Vector2 touchLocation = Vector2.down;
|
||||
touchRecognizer.onEnteredEvent += (r) =>
|
||||
{
|
||||
touchLocation = r.startTouchLocation();
|
||||
startTimpStamp = DateTime.Now;
|
||||
};
|
||||
touchRecognizer.onExitedEvent += (r) =>
|
||||
{
|
||||
if (competitionId == 0 && isStart && IsPointerOverGameObject(touchLocation))
|
||||
{
|
||||
var timespan = DateTime.Now - startTimpStamp;
|
||||
UnityEngine.Debug.Log($"{timespan.TotalMilliseconds}");
|
||||
if (timespan.TotalMilliseconds <= 120)
|
||||
{
|
||||
singleUIManager?.ClearPanel(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
TouchKit.addGestureRecognizer(touchRecognizer);
|
||||
////单指
|
||||
//var touchRecognizer = new TKAnyTouchRecognizer(new TKRect(0, 0, Screen.width, Screen.height));
|
||||
//DateTime startTimpStamp = DateTime.Now;
|
||||
//Vector2 touchLocation = Vector2.down;
|
||||
//touchRecognizer.onEnteredEvent += (r) =>
|
||||
//{
|
||||
// touchLocation = r.startTouchLocation();
|
||||
// startTimpStamp = DateTime.Now;
|
||||
//};
|
||||
//touchRecognizer.onExitedEvent += (r) =>
|
||||
//{
|
||||
// if (competitionId == 0 && isStart && IsPointerOverGameObject(touchRecognizer.STAR))
|
||||
// {
|
||||
// var timespan = DateTime.Now - startTimpStamp;
|
||||
// UnityEngine.Debug.Log($"{timespan.TotalMilliseconds}");
|
||||
// if (timespan.TotalMilliseconds <= 120)
|
||||
// {
|
||||
// singleUIManager?.ClearPanel(null);
|
||||
// }
|
||||
// }
|
||||
//};
|
||||
//TouchKit.addGestureRecognizer(touchRecognizer);
|
||||
//双指
|
||||
var PinchRecognizer = new TKPinchRecognizer();
|
||||
PinchRecognizer.gestureRecognizedEvent += (r) =>
|
||||
@@ -407,14 +407,15 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
float touchTimer = 0.1f;
|
||||
private void FixedUpdate()
|
||||
{
|
||||
HandleTouch();
|
||||
HandleMouseScrollWheel();
|
||||
}
|
||||
public bool isWatch { get; set; }
|
||||
private Vector3 currentCameraPos { get; set; }
|
||||
|
||||
Vector3 far = new Vector3(-18, 53, -48);
|
||||
Vector3 plane = new Vector3(-15, 43, -40);
|
||||
Vector3 near = new Vector3(-12, 35, -30);
|
||||
Vector3 far = new Vector3(-18, 50, -48);
|
||||
Vector3 plane = new Vector3(-15.1f, 42, -40);
|
||||
Vector3 near = new Vector3(-11.4f, 31, -30);
|
||||
List<Vector3> cameraList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -423,8 +424,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
private void HandleMouseScrollWheel()
|
||||
{
|
||||
var scrollDelta = Input.GetAxis("Mouse ScrollWheel");
|
||||
UnityEngine.Debug.Log($"scrolldelta{scrollDelta}");
|
||||
|
||||
|
||||
if (scrollDelta != 0 && Input.mousePosition != null && !IsPointerOverGameObject(Input.mousePosition))
|
||||
return;
|
||||
if (cameraList == null)
|
||||
{
|
||||
cameraList = new List<Vector3>();
|
||||
@@ -450,6 +452,8 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//StartCoroutine(MoveCamera(prePos, nextPos));
|
||||
}
|
||||
}
|
||||
|
||||
DateTime startTimpStamp = DateTime.Now;
|
||||
private void HandleTouch()
|
||||
{
|
||||
if (singleUIManager == null)
|
||||
@@ -459,11 +463,19 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
UnityEngine.Debug.Log(Input.touches[0]);
|
||||
UnityEngine.Debug.Log($"{Input.touches[0]}{Input.touches[0].phase }");
|
||||
//单击切换极简模式
|
||||
if (Input.touches[0].tapCount==1 && Input.touches[0].phase == TouchPhase.Moved && isStart && singleUIManager.clearLock && competitionId == 0)
|
||||
if (Input.touches[0].tapCount == 1 && Input.touches[0].phase == TouchPhase.Began && isStart && singleUIManager.clearLock && competitionId == 0)
|
||||
{
|
||||
if (IsPointerOverGameObject(Input.mousePosition))
|
||||
startTimpStamp = DateTime.Now;
|
||||
}
|
||||
|
||||
//单击切换极简模式
|
||||
if (Input.touches[0].tapCount==1 && Input.touches[0].phase == TouchPhase.Ended && isStart && singleUIManager.clearLock && competitionId == 0)
|
||||
{
|
||||
var interval = DateTime.Now - startTimpStamp;
|
||||
UnityEngine.Debug.Log(interval);
|
||||
if (interval.TotalMilliseconds<=150 && IsPointerOverGameObject(Input.mousePosition))
|
||||
{
|
||||
singleUIManager?.ClearPanel(null);
|
||||
}
|
||||
@@ -472,6 +484,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
return;
|
||||
//双手触摸移动摄像机
|
||||
// Store both touches.
|
||||
Touch touchZero = Input.GetTouch(0);
|
||||
|
||||
@@ -154,10 +154,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#endif
|
||||
var parent = panel.transform.Find("MapRanking");
|
||||
var title = panel.transform.Find("RankingTitle").gameObject;
|
||||
if (list.Count == 0)
|
||||
{
|
||||
title.SetActive(false);
|
||||
}
|
||||
title.SetActive(list.Count != 0);
|
||||
foreach (var item in list)
|
||||
{
|
||||
GameObject newObj = (GameObject)Instantiate(prefab, parent);
|
||||
|
||||
@@ -37,6 +37,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
OnlineUserNum.text = " "+ MapUDPService.GetNearRiderCount().ToString();
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(OnlineUserNum.rectTransform);
|
||||
var nearList = MapUDPService.GetNearRiderData(pageIndex, pageSize, new double[] { playerController.Currentlatlong.x, playerController.Currentlatlong.y });
|
||||
if (nearList == null)
|
||||
return;
|
||||
var mod = MapUDPService.GetNearRiderCount() % pageSize;
|
||||
var pages = MapUDPService.GetNearRiderCount() / pageSize;
|
||||
totalPages = mod > 0 ? pages + 1 : pages;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
//#if UNITY_EDITOR
|
||||
power = 1430;
|
||||
power = 143;
|
||||
//#endif
|
||||
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
timeRemaining = 1.0f;
|
||||
}
|
||||
}
|
||||
countDownTxt.text = count==0?"GO!": count.ToString();
|
||||
countDownTxt.text = count==0?App.GetLocalString("GO!"): count.ToString();
|
||||
}
|
||||
//重置游戏状态
|
||||
public void Reset()
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_delayTime = App.delayTime;
|
||||
if (_delayTime != -1)
|
||||
{
|
||||
appVersion.text = $"<color={getColor(_delayTime)}>{_delayTime.ToString("0")}MS</color>\n{"V" + App.AppVersion}";
|
||||
appVersion.text = $"<color={getColor(_delayTime)}>{_delayTime.ToString("0")}ms</color>\n{"V" + App.AppVersion}";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user