重置问题

This commit is contained in:
Caiyanpeng committed 2022-06-08 13:55:35 +08:00
1 parent c7afcbb01f
commit c333086e30
8 files changed
+3238 -1429

No files matched your search

@@ -459,6 +459,12 @@ public class RowerHomeScript : PFUIPanel
int truelyTime = 0;
private void StartFunc(object sender, EventArgs e)
{
if (UIManager.Instance.confirm!=null && UIManager.Instance.confirm.IsActive())
{
print("当前有弹窗");
return;
}
if (openTimer) return;
Id = Guid.NewGuid().ToString();
if (transform.parent.parent.Find("ModalPanel/RowerWelldone(Clone)") && transform.parent.parent.Find("ModalPanel/RowerWelldone(Clone)").gameObject.activeInHierarchy)
@@ -773,6 +779,7 @@ public class RowerHomeScript : PFUIPanel
{
#if UNITY_EDITOR
var a = tempList[(tempx++) % tempList.Count];
Debug.Log(a);
PaintPullCurve((ushort)(a / 10));
if (RowerData == null) return;
#endif
@@ -1152,12 +1159,11 @@ public class RowerHomeScript : PFUIPanel
//if (pullList.Count == 0)
if(pointCount == 0)
{
ClearChart("Player 2");
isPlay = true;
x = 0.1;
pointCount++;
pullList.Add(new DoubleVector2(x, y));
//SetChartData(pullList, historyPullList);
ClearChart();
SetChartData(x, y);
}
//else if (pullList.Count > 1)
@@ -1167,29 +1173,34 @@ public class RowerHomeScript : PFUIPanel
pointCount++;
pullList.Add(new DoubleVector2(x, y));
SetChartData(x, y);
//SetChartData(pullList, historyPullList);
historyPullList = pullList.Select(x => x).ToList();
pullList.Clear();
pointCount = 0;
//ClearChart();
x = 0.1;
SetChartData(x, y);
//SetChartData(x, y);
pointCount = 1;
isPlay = true;
//isPlay = true;
pullList.Add(new DoubleVector2(x, y));
}
else
{
//只有0并且两秒没拉,曲线消失
if (stopSeconds == 1)
if (stopSeconds == 1)
{
ClearChart();
ClearChart("Player 1");
ClearChart("Player 2");
//SetChartData(new List<DoubleVector2>(), new List<DoubleVector2>());
}
}
}
else
{
if (pullList.Count(x => x.y == 0) == pullList.Count)
{
ClearChart("Player 2");
pointCount = 0;
SetChartData(0.1, 0);
}
x += 0.1;
pointCount++;
pullList.Add(new DoubleVector2(x, y));
@@ -1216,10 +1227,10 @@ public class RowerHomeScript : PFUIPanel
// x += 0.1f;
//}
}
void ClearChart()
void ClearChart(string cateName)
{
rowerGraphChartFeed.ClearChart();
graphChartFeed.ClearChart();
rowerGraphChartFeed.ClearChart(cateName);
graphChartFeed.ClearChart(cateName);
}
double preX, preY;
void SetChartData(double x, double y)
@@ -1265,7 +1276,7 @@ public class RowerHomeScript : PFUIPanel
ShortUpdateData();
shortTimer += 0.25f;
}
if (openTimer && timer <= 0)
if (timer <= 0)
{
TimerTicks();
ticks++;
@@ -1331,9 +1342,8 @@ public class RowerHomeScript : PFUIPanel
transform.Find("Ready/Img").gameObject.SetActive(flag);
transform.Find("Ready/Text").gameObject.SetActive(flag);
transform.Find("Ready/DeviceStatusConnect").gameObject.SetActive(flag);
if (!isFirstReset && flag)
if (flag && RowerData.TotalDistance != 0)
{
isFirstReset = true;
Rower.Reset();
//RowerData.Reset();
}
@@ -35,7 +35,7 @@ public class RowerDeviceView : MonoBehaviour
private GameObject mDisconnectButton;
private GameObject unconnectionPanel;
private GameObject connectionPanel;
private Text searchState;
private Text searchState,connSearchState;
private ConnectDeviceModal deviceModal;
private Text title;
private Text noDevice;
@@ -69,7 +69,7 @@ public class RowerDeviceView : MonoBehaviour
searchState = unconnectionPanel.transform.Find("SearchState").GetComponent<Text>();
//mPairButton.SetActive(false);
connectionPanel = this.transform.Find("ConnectionPanel").gameObject;
connSearchState = connectionPanel.transform.Find("SearchState").GetComponent<Text>();
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
var rect = ((RectTransform)transform).rect;
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height * 0.2f, 0));
@@ -251,7 +251,7 @@ public class RowerDeviceView : MonoBehaviour
logo.sprite = sprite0;
searchState.text = App.GetLocalString("Searching...");
searchState.text = App.GetLocalString("CHOOSE DEVICE");
var hasDevice = false;
if (SensorType == SensorType.SpeedCadence)
{
@@ -261,7 +261,7 @@ public class RowerDeviceView : MonoBehaviour
{
hasDevice = App.MainDeviceAdapter.GetDevices().Any(d => d.Sensor == SensorType);
}
noDevice.text = hasDevice ? App.GetLocalString("CHOOSE DEVICE") : App.GetLocalString("NO DEVICE");
noDevice.text = "";// App.GetLocalString("NOCONN DEVICE"); //hasDevice ? App.GetLocalString("CHOOSE DEVICE") : ;
if (hasDevice)
{
mSearchButton.SetActive(false);
@@ -325,7 +325,6 @@ public class RowerDeviceView : MonoBehaviour
}
logo.sprite = sprite3;
//title.text = connectedDevice.Name;
if (connectedDevice.Network == NetworkType.BLE)
{