-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCameraMovementLv5.cs
38 lines (34 loc) · 1.37 KB
/
CameraMovementLv5.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using UnityEngine;
public class CameraMovementLv5 : MonoBehaviour
{
public Transform raceSet;
public Transform BG;
// Update is called once per frame
void Update()
{
switch (raceSet.childCount)
{
case 87:
transform.position = Vector3.Lerp(transform.position, new Vector3(48, 9, transform.position.z), 0.1f);
BG.position = Vector3.Lerp(BG.position, new Vector3(48, 9, BG.position.z), 0.1f);
break;
case 52:
transform.position = Vector3.Lerp(transform.position, new Vector3(48, 27, transform.position.z), 0.1f);
BG.position = Vector3.Lerp(BG.position, new Vector3(48, 27, BG.position.z), 0.1f);
break;
case 16:
transform.position = Vector3.Lerp(transform.position, new Vector3(48, 45, transform.position.z), 0.1f);
BG.position = Vector3.Lerp(BG.position, new Vector3(48, 45, BG.position.z), 0.1f);
break;
case 0:
if (LoadSceneOnClickForMainMenu.isPlayingCampaign)
{
if (PlayerPrefs.GetInt("Level5Unlocked") != 5)
{
PlayerPrefs.SetInt("Level5Unlocked", 5);
}
}
break;
}
}
}