阻力灵敏度bug

This commit is contained in:
lishuo committed 2021-04-29 23:44:47 +08:00
1 parent b030294bd6
commit aaef57c0b0
6 files changed
+2589 -2595

No files matched your search

+1 -1
View File
@@ -653,7 +653,7 @@ Light:
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.9764706, b: 0.5411765, a: 1}
m_Color: {r: 0.93333334, g: 0.9019608, b: 0.90588236, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
+2577 -2577
View File
File diff suppressed because it is too large. Load diff
@@ -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);
}
}