5.9修改暂存

This commit is contained in:
Caiyanpeng committed 2022-05-10 18:43:41 +08:00
1 parent cfa1cc4f7b
commit edc629ed75
12 files changed
+5666 -2147

No files matched your search

@@ -87,7 +87,7 @@ public class RowerHomeScript : PFUIPanel
}
}
GameObject btnStart;
Transform left, bottom, mid;
Transform left, bottom, mid,rmydata;
float timer = 1.0f;
List<DoubleVector2> pullList = new List<DoubleVector2>(), historyPullList = new List<DoubleVector2>();
public Dictionary<object, Sprite> spriteDict,spriteDict2;
@@ -163,6 +163,7 @@ public class RowerHomeScript : PFUIPanel
left = transform.Find("Rower/Modes/Scroll/M1/Left");
bottom = transform.Find("Rower/Bottom");
mid = transform.Find("Rower/Modes/Scroll/M1/Mid");
rmydata = transform.Find("Rower/Modes/Scroll/M2/MyData");
slider = transform.Find("ResBar/PFUISlider");
UIManager.AddEvent(transform.Find("ResBar/BtnAdd").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
@@ -210,7 +211,7 @@ public class RowerHomeScript : PFUIPanel
{
//UIManager.ShowRowerWelldone("33171855-66FC-4121-935C-0F4DA98E5BB2", Init);
//return;
//UIManager.ShowRowerWelldone("2B6E8414-AF47-4B49-99E9-A89B83C65305", Init);
//UIManager.ShowRowerWelldone("1915400E-A6E5-4FB7-B371-7240BEA20A54", Init);
//return;
if (checkRowing()) return;
if (C2RowerData.IsEnabled == true && C2RowerData.rowerType != null) return;
@@ -229,7 +230,8 @@ public class RowerHomeScript : PFUIPanel
{
ReturnHome();
}, false);
nav.SetButtonActive(new List<int> { 3, 7 }, null, c1, null, c3, false);
//隐藏骑行
nav.SetButtonActive(new List<int> { 3, 7 }, null, c1, null, null, false);
newNav = nav;
#endif
UIManager.AddEvent(transform.Find("Stopped/Confirm/BtnSave").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
@@ -470,7 +472,7 @@ public class RowerHomeScript : PFUIPanel
startTime = UIManager.Now.GetDateTime();
createTime = null;
truelyTime = 0;
TimerTicks();
//TimerTicks();
openTimer = true;
timer = 1.0f;
}
@@ -599,10 +601,11 @@ public class RowerHomeScript : PFUIPanel
left.Find("RightImage/Value").GetComponent<Image>().fillAmount = 0;
left.Find("Times/Value").GetComponent<Text>().text = "---";
left.Find("Calories/Value").GetComponent<Text>().text = "---";
rmydata.Find("Calories/Value").GetComponent<Text>().text = "---";
pullList = new List<DoubleVector2>();
historyPullList = new List<DoubleVector2>();
mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(pullList);
SetChartData(pullList, historyPullList);
//mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(pullList);
openTimer = false;
if (rowerType.type == 0)
{
@@ -624,6 +627,7 @@ public class RowerHomeScript : PFUIPanel
}
mid.Find("W/Value").GetComponent<Text>().text = "---";
rmydata.Find("W/Value").GetComponent<Text>().text = "---";
bottom.Find("500/Value").GetComponent<Text>().text = "---";
bottom.Find("MS/Value").GetComponent<Text>().text = "---";
//bottom.Find("MS/AvgValue").GetComponent<Text>().text = "---";
@@ -631,7 +635,9 @@ public class RowerHomeScript : PFUIPanel
bottom.Find("Expected/Value").GetComponent<Text>().text = "---";
bottom.Find("Expected/Title").GetComponent<Text>().text = bottom.Find("Expected/Title").GetComponent<Text>().text.Replace("EST",App.GetLocalString("EST"));
mid.Find("AvgForce/Value").GetComponent<Text>().text = "---";
rmydata.Find("AvgForce/Value").GetComponent<Text>().text = "---";
mid.Find("PeakForce/Value").GetComponent<Text>().text = "---";
rmydata.Find("PeakForce/Value").GetComponent<Text>().text = "---";
records = new List<string>();
values = new List<TempRowerCalc>();
Kj = 0;
@@ -697,7 +703,7 @@ public class RowerHomeScript : PFUIPanel
}
// Update is called once per frame
bool openTimer = false;
public bool openTimer { get; private set; } = false;
double x = 0f;
#if UNITY_EDITOR
@@ -770,6 +776,7 @@ public class RowerHomeScript : PFUIPanel
bottom.Find("Time/Value").GetComponent<Text>().text = TimeSpan.FromSeconds(++seconds).ToPFString();
}
mid.Find("W/Value").GetComponent<Text>().text = "---";
rmydata.Find("W/Value").GetComponent<Text>().text = "---";
bottom.Find("500/Value").GetComponent<Text>().text = "---";
bottom.Find("MS/Value").GetComponent<Text>().text = "---";
bottom.Find("Expected/Value").GetComponent<Text>().text = "---";
@@ -786,13 +793,16 @@ public class RowerHomeScript : PFUIPanel
mid.Find("W/Value").GetComponent<Text>().text = power.ToString();
rmydata.Find("W/Value").GetComponent<Text>().text = power.ToString();
bottom.Find("500/Value").GetComponent<Text>().text = TimeSpan.FromSeconds(pace).ToPFString();
bottom.Find("MS/Value").GetComponent<Text>().text = rate.ToString();
left.Find("Times/Value").GetComponent<Text>().text = strokeCount.ToString();
left.Find("Calories/Value").GetComponent<Text>().text = energy.ToString();
rmydata.Find("Calories/Value").GetComponent<Text>().text = energy.ToString();
mid.Find("AvgForce/Value").GetComponent<Text>().text = RowerCommonDataInstance.AverageDriveForce.ToString("#0");
rmydata.Find("AvgForce/Value").GetComponent<Text>().text = RowerCommonDataInstance.AverageDriveForce.ToString("#0");
mid.Find("PeakForce/Value").GetComponent<Text>().text = RowerCommonDataInstance.PeakDriveForce.ToString("#0");
rmydata.Find("PeakForce/Value").GetComponent<Text>().text = RowerCommonDataInstance.PeakDriveForce.ToString("#0");
if (pace != 0)
{
if (rowerType.type == 1)
@@ -926,13 +936,13 @@ public class RowerHomeScript : PFUIPanel
isPlay = true;
x = 0.1;
pullList.Add(new DoubleVector2(x, y));
mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(pullList, historyPullList);
SetChartData(pullList, historyPullList);
}
else if (pullList.Count > 1)
{
x += 0.1;
pullList.Add(new DoubleVector2(x, y));
mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(pullList, historyPullList);
SetChartData(pullList, historyPullList);
historyPullList = pullList.Select(x => x).ToList();
pullList.Clear();
x = 0.1;
@@ -944,7 +954,7 @@ public class RowerHomeScript : PFUIPanel
//只有0并且两秒没拉,曲线消失
if (stopSeconds == 1)
{
mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(new List<DoubleVector2>(), new List<DoubleVector2>());
SetChartData(new List<DoubleVector2>(), new List<DoubleVector2>());
}
}
}
@@ -958,7 +968,7 @@ public class RowerHomeScript : PFUIPanel
isPlay = false;
left.Find("Rower").GetComponent<RowerAnimation>().StartAnimation();
}
mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(pullList, historyPullList);
SetChartData(pullList, historyPullList);
}
//Debug.Log($"{x},{y}");
//transform.Find("Mid/GraphChart").GetComponent<RowerGraphChartFeed>().SetData(pullList);
@@ -973,7 +983,12 @@ public class RowerHomeScript : PFUIPanel
// x += 0.1f;
//}
}
float staticTimer = 1f,shortTimer = 0.1f;
void SetChartData(List<DoubleVector2> v1, List<DoubleVector2> v2)
{
mid.Find("GraphChart").GetComponent<RowerGraphChartFeed>().SetData(v1,v2);
transform.Find("Rower/Modes/Scroll/M2/MyData/GraphChart").GetComponent<RowerGraphChartFeed>().SetData(v1);
}
float staticTimer = 1f,shortTimer = 0.25f;
void Update()
{
#if UNITY_EDITOR
@@ -983,7 +998,13 @@ public class RowerHomeScript : PFUIPanel
#endif
{
timer -= Time.deltaTime;
if (timer <= 0)
shortTimer -= Time.deltaTime;
if (shortTimer <= 0)
{
ShortUpdateData();
shortTimer += 0.25f;
}
if (openTimer && timer <= 0)
{
TimerTicks();
timer = 1f + timer;
@@ -997,15 +1018,15 @@ public class RowerHomeScript : PFUIPanel
staticTimer += 1f;
}
shortTimer -= Time.deltaTime;
if (shortTimer <= 0)
{
if (openTimer)
{
ShortUpdateData();
}
shortTimer += 0.1f;
}
//shortTimer -= Time.deltaTime;
//if (shortTimer <= 0)
//{
// if (openTimer)
// {
// ShortUpdateData();
// }
// shortTimer += 0.5f;
//}
}
void ShortUpdateData()
@@ -1034,6 +1055,7 @@ public class RowerHomeScript : PFUIPanel
return;
}
mid.Find("W/Value").GetComponent<Text>().text = power.ToString();
rmydata.Find("W/Value").GetComponent<Text>().text = power.ToString();
bottom.Find("500/Value").GetComponent<Text>().text = TimeSpan.FromSeconds(pace).ToPFString();
bottom.Find("MS/Value").GetComponent<Text>().text = rate.ToString();
}