伴侣骑行不选人点击确定报错bug修复;3d视角调整;倒计时优化;

This commit is contained in:
lishuo 2021-05-25 18:13:59 +08:00
parent 3757ae6e6c
commit 4e4da38252
6 changed files with 3645 additions and 4152 deletions

View File

@ -198,7 +198,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 215, y: 48}
m_SizeDelta: {x: 225, y: 48}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8877223148509276859
CanvasRenderer:

File diff suppressed because it is too large Load Diff

View File

@ -178,8 +178,6 @@ namespace Assets.Scenes.Ride.Scripts
{
if (graph != null)
{
Debug.Log("Loading page :" + pagePosition);
graph.DataSource.StartBatch(); // call start batch
graph.DataSource.HorizontalViewOrigin = 0;

View File

@ -56,7 +56,7 @@ namespace Assets.Scenes.Ride.Scripts
bicycleWeight = App.CurrentUser.BicycleWeight;
//#if UNITY_EDITOR
System.Random rd = new System.Random();
power = 5000; //rd.Next(150, 300);//测试功率
power = 1000; //rd.Next(150, 300);//测试功率
//#endif
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity / 100);
}

View File

@ -111,6 +111,9 @@ namespace Assets.Scenes.Ride.Scripts
OnEndDrag(null);
}
}
bool enabled = gameObjects.Where(c => c.GetComponent<SeletedPlayerScript>().isUsed).Count() > 0;
rideButton.enabled = enabled;
rideButton.interactable = enabled;
}
private void StartvalueChanged(string input)
{

View File

@ -103,6 +103,8 @@ namespace Assets.Scenes.Ride.Scripts
Image currentSlopeProcess;
Text miniMapProcessText;
Slider cameraSlider;
void Awake()
{
#region
@ -187,6 +189,19 @@ namespace Assets.Scenes.Ride.Scripts
//小地图进度
miniMapProcess = transform.Find("Panel/MiniMap/Process").GetComponent<Image>();
miniMapProcessText = transform.Find("Panel/MiniMap/Process/Text").GetComponent<Text>();
//开发者视角调整
cameraSlider = transform.Find("Panel/CameraSlider").GetComponent<Slider>();
Text Cameray = transform.Find("Panel/CameraSlider/Text").GetComponent<Text>();
string[] phoneList = new string[] { "18120141032", "15651831367", "13115011550","15261826280" };
if (phoneList.Contains(App.CurrentUser.Phone))
{
cameraSlider.gameObject.SetActive(true);
cameraSlider.onValueChanged.AddListener((f) =>
{
cameraY = f;
Cameray.text = f.ToString("f0");
});
}
UIManager.AddEvent(startBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, StartRide);
UIManager.AddEvent(simpleBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ClearPanel);
@ -329,7 +344,7 @@ namespace Assets.Scenes.Ride.Scripts
}
}
Vector3 m = new Vector3(0.1f, 0.1f, 0.1f);
Vector3 CameraVector = Vector3.zero;
//移动摄像头和箭头位置
private void MoveCamera()
{
@ -346,7 +361,10 @@ namespace Assets.Scenes.Ride.Scripts
}
else
{
target.transform.eulerAngles = new Vector3(cameraX, cameraY, cameraZ);
CameraVector.x = cameraX;
CameraVector.y = cameraY;
CameraVector.z = cameraZ;
target.transform.eulerAngles = CameraVector;
}
//控制照片移动
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
@ -372,7 +390,7 @@ namespace Assets.Scenes.Ride.Scripts
if (count == 0)
{
mainController.SetStart();
countDownTxt.gameObject.SetActive(false);
countDownTxt.transform.GetComponent<CanvasGroup>().DOFade(0, 1);
}
if (count == 1 && mainController.cyclingModel == CyclingModel.Single)
{
@ -380,10 +398,12 @@ namespace Assets.Scenes.Ride.Scripts
//附近的人
// nearByPanel.GetComponent<CanvasGroup>().DOFade(0, 1);
}
countDownTxt.transform.DOPunchScale(new Vector3(1.2f, 1.2f, 1.2f),1,1,1);
timeRemaining = 1.0f;
}
}
countDownTxt.text = count.ToString();
countDownTxt.text = count==0?"GO!": count.ToString();
}
private void BindDataSource()
{