曲线调整
This commit is contained in:
1 parent
f47f5c9ff6
commit
3c4ecf3e83
8 files changed
+2279
-1977
No files matched your search
@@ -32,7 +32,7 @@ public class RowerGraphChartFeed : MonoBehaviour
|
||||
// StartCoroutine(ClearAll());
|
||||
}
|
||||
|
||||
public void SetData(List<DoubleVector2> list)
|
||||
public void SetData(List<DoubleVector2> list,List<DoubleVector2> list2 = null)
|
||||
{
|
||||
GraphChartBase graph = GetComponent<GraphChartBase>();
|
||||
if (graph != null)
|
||||
@@ -41,15 +41,24 @@ public class RowerGraphChartFeed : MonoBehaviour
|
||||
//graph.HorizontalValueToStringMap[0.0] = "Zero"; // example of how to set custom axis strings
|
||||
graph.DataSource.StartBatch();
|
||||
graph.DataSource.ClearCategory("Player 1");
|
||||
graph.DataSource.ClearCategory("Player 2");
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var item = list[i];
|
||||
graph.DataSource.AddPointToCategory("Player 1", item.x, item.y);
|
||||
graph.DataSource.AddPointToCategory("Player 2", item.x, item.y);
|
||||
//if (i == 0)
|
||||
// graph.DataSource.SetCurveInitialPoint("Player 1", item.x, item.y);
|
||||
//else
|
||||
// graph.DataSource.AddLinearCurveToCategory("Player 1", new DoubleVector2(item.x, item.y));
|
||||
}
|
||||
if (list2 != null)
|
||||
{
|
||||
for (int i = 0; i < list2.Count; i++)
|
||||
{
|
||||
var item = list2[i];
|
||||
graph.DataSource.AddPointToCategory("Player 1", item.x, item.y);
|
||||
}
|
||||
}
|
||||
//graph.DataSource.MakeCurveCategorySmooth("Player 1");
|
||||
graph.DataSource.EndBatch();
|
||||
}
|
||||
|
||||
@@ -375,7 +375,8 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
rightPositionX = ((diffWidth + rightDiff) / 100f) * width + 43;
|
||||
if (leftPositionX >= -30 && leftPositionX<=415)
|
||||
{
|
||||
leftLine.DOLocalMoveX(leftPositionX - 207.5f, 0.9f);
|
||||
StartCoroutine(MoveLine(leftLine, leftLine.localPosition, new Vector3(leftPositionX - 207.5f, leftLine.localPosition.y, leftLine.localPosition.z)));
|
||||
//leftLine.DOLocalMoveX(leftPositionX - 207.5f, 0.9f);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -383,7 +384,8 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
}
|
||||
if (rightPositionX >= 0 && rightPositionX <= 415)
|
||||
{
|
||||
rightLine.DOLocalMoveX(rightPositionX - 207.5f, 0.9f);
|
||||
StartCoroutine(MoveLine(rightLine, rightLine.localPosition, new Vector3(rightPositionX - 207.5f, rightLine.localPosition.y, rightLine.localPosition.z)));
|
||||
//rightLine.DOLocalMoveX(rightPositionX - 207.5f, 0.9f);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -401,7 +403,8 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
float finishPositionX = ((diffWidth + finishDiff) / 100f) * width + 43;
|
||||
if (finishPositionX >= 0 && finishPositionX <= 415)
|
||||
{
|
||||
finishLine.DOLocalMoveX(finishPositionX - 207.5f, 0.9f);
|
||||
StartCoroutine(MoveLine(finishLine, finishLine.localPosition, new Vector3(finishPositionX - 207.5f, finishLine.localPosition.y, finishLine.localPosition.z)));
|
||||
//finishLine.DOLocalMoveX(finishPositionX - 207.5f, 0.9f);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -419,13 +422,13 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
{
|
||||
var tWidth = (diffWidth / 100f) * width;
|
||||
t.Find("Main/Boat").gameObject.SetActive(true);
|
||||
t.Find("Left/Rank").GetComponent<Text>().text = (userList.FindIndex(x => x.UserId == data.UserId) + 1).ToString("00");
|
||||
if (isAni)
|
||||
{
|
||||
t.Find("Main/Boat").DOLocalMoveX(21.5f + tWidth, 0.9f);
|
||||
var rowed = t.Find("Main/Rowed").GetComponent<RectTransform>();
|
||||
//rowed.GetComponent<UIGradient>().color1 = data.isMine ? Utils.HexToColorHtml("#f9308633") : Utils.HexToColorHtml("#27bac033");
|
||||
//rowed.GetComponent<UIGradient>().color2 = data.isMine ? Utils.HexToColorHtml("#f930864d") : Utils.HexToColorHtml("#27bac04d");
|
||||
t.Find("Left/Rank").GetComponent<Text>().text = (userList.FindIndex(x => x.UserId == data.UserId) + 1).ToString("00");
|
||||
rowed.DOSizeDelta(new Vector2(tWidth, rowed.sizeDelta.y), 0.9f);
|
||||
}
|
||||
else
|
||||
@@ -449,11 +452,11 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
var spDict = GetComponent<RowerHomeScript>().spriteDict2;
|
||||
int spDictIndex = 0;
|
||||
|
||||
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat/Image").GetComponent<Image>().sprite = spDict[x], 14, 0.3f));
|
||||
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat/Image").GetComponent<Image>().sprite = spDict[x], 14, 0.225f));
|
||||
ani.AppendCallback(() =>
|
||||
{
|
||||
int spDictIndex2 = 14;
|
||||
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat/Image").GetComponent<Image>().sprite = spDict[x], 0, 0.6f);
|
||||
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat/Image").GetComponent<Image>().sprite = spDict[x], 0, 0.675f);
|
||||
});
|
||||
ani.Play();
|
||||
//var _pred = data.list[currentSecond - 1];
|
||||
@@ -474,6 +477,17 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
|
||||
}
|
||||
}
|
||||
private IEnumerator MoveLine(Transform line, Vector3 originLocation, Vector3 targetLocation)
|
||||
{
|
||||
float t = 0;
|
||||
while (t < 1)
|
||||
{
|
||||
t += Time.deltaTime;
|
||||
Vector3 v = Vector3.Lerp(originLocation, targetLocation, t);
|
||||
line.localPosition = v;
|
||||
yield return new WaitForEndOfFrame();
|
||||
}
|
||||
}
|
||||
private int getStartIndexByMineData()
|
||||
{
|
||||
var list = userList;
|
||||
|
||||
Reference in new issue
Block a user