Skip to content

Commit 1209871

Browse files
committed
ver 0.2
Added English headers and changed some parameter names
1 parent 936e43d commit 1209871

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

Assets/Scripts/MathPart/GraphCreator.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,43 @@
66

77
public class GraphCreator : MonoBehaviour {
88

9-
[Header("Точки для вставки в график")]
10-
[SerializeField] GameObject PointFor;
9+
[Header("Точки для вставки в график / Points to insert into the graph")]
10+
[SerializeField] GameObject PointToInsert;
1111
[SerializeField] Transform PointForUTransform;
1212
protected Transform PointForUTransformTmp;
1313

14-
[Header("UILineRenderer для создания графикa")]
14+
[Header("UILineRenderer для создания графикa / UILineRenderer to create a graph")]
1515
[SerializeField] UILineRenderer LineRenderForCreateGraph;
1616

17-
[Header("Список вставленных точек в график")]
17+
[Header("Список вставленных точек в график / List of inserted points in the graph")]
1818
public List<GameObject> InstancePoints;
1919

20-
[Header("Сам график, где рисовать")]
21-
[SerializeField] GameObject Grafik;
20+
[Header("Сам график, где рисовать / The graph where to draw")]
21+
[SerializeField] GameObject Graph;
2222

23-
[Header("Объект, хранящий значения на осях")]
23+
[Header("Объект, хранящий значения на осях / values ​​on axes")]
2424
[SerializeField]
2525
Transform axisTextHolder;
2626

27-
[Header("Длина осей в графике по сторонам Х и У")]
27+
[Header("Длина осей в графике по сторонам Х и У / The length of the axes in the graph on the sides X and Y")]
2828
[SerializeField] float sizeStepX = 50;
2929
[SerializeField] float sizeStepY = 50;
3030

31-
[Header("Количество шагов по оси Х")]
31+
[Header("Количество шагов по оси Х / Number of steps along the axis X")]
3232
[SerializeField]
3333
int Xsteps;
34-
[Header("Количество шагов по оси Y")]
34+
[Header("Количество шагов по оси Y/ Number of steps along the axis Y")]
3535
[SerializeField]
3636
int Ysteps;
3737

3838
public List<Vector2> dataPoints = new List<Vector2>();
3939
RectTransform mainTransform;
4040

41-
[Header("стартовая координата по оси Х")]
41+
[Header("стартовая координата по оси Х / X-axis origin")]
4242
[SerializeField]
4343
float StartCoordinateX = 0;
4444

45-
[Header("стартовая координата по оси У")]
45+
[Header("стартовая координата по оси У / Y-axis origin")]
4646
[SerializeField]
4747
float StartCoordinateY = 0;
4848
protected float step = 0;
@@ -138,23 +138,22 @@ public void AddPoint() {
138138
if (ValidateAddingPoint()) {
139139
if (lastPoint == new Vector2(valueX, valueY)) return;
140140
dataPoints.Insert(0, new Vector2(valueX, valueY));
141-
InstancePoints.Insert(0, Instantiate(PointFor, PointForUTransform.position,
141+
InstancePoints.Insert(0, Instantiate(PointToInsert, PointForUTransform.position,
142142
PointForUTransform.rotation));
143143
InstancePoints[0].SetActive(true);
144-
InstancePoints[0].transform.SetParent(PointFor.transform.parent);
144+
InstancePoints[0].transform.SetParent(PointToInsert.transform.parent);
145145
InstancePoints[0].transform.localScale = Vector3.one;
146146
InstancePoints[0].GetComponent<RectTransform>().anchoredPosition =
147147
new Vector3(InstancePoints[0].GetComponent<RectTransform>().anchoredPosition.x
148148
+ valueX *
149-
Grafik.GetComponent<RectTransform>().sizeDelta.x / sizeStepX,
149+
Graph.GetComponent<RectTransform>().sizeDelta.x / sizeStepX,
150150
InstancePoints[0].GetComponent<RectTransform>().anchoredPosition.y
151151
+ valueY *
152-
Grafik.GetComponent<RectTransform>().sizeDelta.y / sizeStepY, 0);
152+
Graph.GetComponent<RectTransform>().sizeDelta.y / sizeStepY, 0);
153153
LineRenderForCreateGraph.Points = new Vector2[InstancePoints.Count];
154154
for (int i = 0; i < InstancePoints.Count; i++) {
155155
LineRenderForCreateGraph.Points[i] = new Vector2(InstancePoints[i].GetComponent<RectTransform>().anchoredPosition.x,
156156
InstancePoints[i].GetComponent<RectTransform>().anchoredPosition.y);
157-
158157
}
159158
lastPoint = new Vector2(valueX, valueY);
160159
}

0 commit comments

Comments
 (0)