Skip to content

Commit f100d5b

Browse files
committed
build v0.3-demo.5
1 parent 6a86fd4 commit f100d5b

136 files changed

Lines changed: 26293 additions & 353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/Prefabs/GameManager_Track_1.prefab

Lines changed: 862 additions & 141 deletions
Large diffs are not rendered by default.

Assets/Scenes/Track_1.unity

Lines changed: 87 additions & 205 deletions
Large diffs are not rendered by default.

Assets/Scripts/Game Manager/ScoreDashboard.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ public class ScoreDashboard : MonoBehaviour
1111
public GameObject[] scoredashboardColumns;
1212
public GameObject[] generalScoredashboardColumns;
1313

14+
public GameObject backgroundCanvas;
15+
1416
private Dictionary<string, carSpec> carsData;
1517

1618
private int scoredashboardIndexMax = 4;
19+
private int scoredashboardSplitSize = 30;
1720
TMPro.TextMeshProUGUI[] compTextTMP; // TMP Array from Game Objects' Components
1821

1922
// Start is called before the first frame update
@@ -25,8 +28,9 @@ void Start()
2528
}
2629

2730
// Update is called once per frame
28-
void LateUpdate()
31+
void FixedUpdate()
2932
{
33+
changeBackgroundSize();
3034
}
3135

3236
public void updateCarSpec(carSpec carSpec)
@@ -37,8 +41,8 @@ public void updateCarSpec(carSpec carSpec)
3741

3842
private void updateScoreDash()
3943
{
40-
updateScoreDashboard(scoredashboardColumns, 20, true);
41-
updateScoreDashboard(generalScoredashboardColumns, 30);
44+
updateScoreDashboard(scoredashboardColumns, scoredashboardSplitSize, true);
45+
updateScoreDashboard(generalScoredashboardColumns, scoredashboardSplitSize);
4246
}
4347

4448
private void parseCarSpec()
@@ -58,6 +62,13 @@ private void parseCarSpec()
5862
}
5963
}
6064

65+
private void changeBackgroundSize()
66+
{
67+
RectTransform rt = backgroundCanvas.GetComponent<RectTransform>();
68+
int columnCounts = (int)(carsData.Count / scoredashboardSplitSize) + 1;
69+
rt.offsetMax = new Vector2(-(-530 * columnCounts + 1910), rt.offsetMax.y);
70+
}
71+
6172
private void updateScoreDashboard(GameObject[] columns, int splitNum, bool scoreDash = false)
6273
{
6374
var sortedCarsData = carsData.OrderByDescending(pair => pair.Value.automoveTargetsTotalCount)

Assets/Scripts/PlayerControll.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private void switchCameraPosition()
9393
{
9494
playerCamera.transform.localRotation = Quaternion.Euler(35, 0, 0);
9595
transform.rotation = Quaternion.Euler(0, -160, 0);
96-
transform.position = new Vector3(-25f, 18f, -12f);
96+
transform.position = new Vector3(-70f, 30f, 0f);
9797
//playerCamera.transform.localRotation = Quaternion.Euler(35, 0, 0);
9898
//transform.rotation = Quaternion.Euler(0, -160, 0);
9999
//transform.position = new Vector3(1.8f, 35f, 6f);
@@ -153,7 +153,7 @@ private void switchCameraPosition()
153153
{
154154
playerCamera.transform.localRotation = Quaternion.Euler(90, 0, 0);
155155
transform.rotation = Quaternion.Euler(0, -180, 0);
156-
transform.position = new Vector3(2f, 147.5f, -160f);
156+
transform.position = new Vector3(2f, 175f, -160f);
157157
}
158158
}
159159
}
651 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)