阻力灵敏度bug
This commit is contained in:
1 parent
b030294bd6
commit
aaef57c0b0
6 files changed
+2589
-2595
No files matched your search
@@ -11,18 +11,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public void TrackResistance(double grade)
|
||||
{
|
||||
if (grade > 10)
|
||||
{
|
||||
grade = 10;
|
||||
}
|
||||
if (grade <-10 )
|
||||
{
|
||||
grade = -10;
|
||||
}
|
||||
|
||||
var device = (_device as FitDevice);
|
||||
if (device != null)
|
||||
{
|
||||
Debug.Log(grade);
|
||||
device.SetTrackResistance(grade);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,9 +175,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
void StartRide(BaseEventData baseEvent)
|
||||
{
|
||||
var checkAnt = cyclingController.CheckAnt();
|
||||
#if UNITY_EDITOR
|
||||
checkAnt = true;
|
||||
#endif
|
||||
//#if UNITY_EDITOR
|
||||
// checkAnt = true;
|
||||
//#endif
|
||||
if (!checkAnt)
|
||||
{
|
||||
var alert = (GameObject)Instantiate(Resources.Load("UI/Prefab/Ride/Alert"), panel.transform);
|
||||
|
||||
@@ -32,10 +32,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cadance = mainController.UpdateCadence();
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
#if UNITY_EDITOR
|
||||
power = 2000;//测试功率
|
||||
#endif
|
||||
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity);
|
||||
//#if UNITY_EDITOR
|
||||
//power = 2000;//测试功率
|
||||
//#endif
|
||||
Debug.Log(currentSlope.ToString() + "==" + App.rideSetting.sensitivity.ToString());
|
||||
//mainController.CheckAnt();
|
||||
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity/100);
|
||||
speed = Helper.CalculateSpeed(elevation, currentSlope, power, weight, bicycleWeight);
|
||||
distance = mainController.UpdateDistance(speed);
|
||||
totalDistance += distance;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
private void Save(BaseEventData baseEventData)
|
||||
{
|
||||
App.rideSetting.sensitivity = Math.Round(slider.value,0) /100;
|
||||
App.rideSetting.sensitivity = Math.Round(slider.value,0);
|
||||
transform.parent.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user