-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCameraMovementLv4.cs
37 lines (34 loc) · 1.37 KB
/
CameraMovementLv4.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
using UnityEngine;
public class CameraMovementLv4 : MonoBehaviour
{
public Transform raceSet;
public Transform BG;
// Update is called once per frame
void Update()
{
switch (raceSet.childCount)
{
case 59:
transform.position = Vector3.Lerp(transform.position, new Vector3(16, 27, transform.position.z), 0.1f);
BG.position = Vector3.Lerp(BG.position, new Vector3(16, 27, BG.position.z), 0.1f);
break;
case 40:
transform.position = Vector3.Lerp(transform.position, new Vector3(46, 27, transform.position.z), 0.1f);
BG.position = Vector3.Lerp(BG.position, new Vector3(46, 27, BG.position.z), 0.1f);
break;
case 25:
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 0:
if (LoadSceneOnClickForMainMenu.isPlayingCampaign)
{
if (PlayerPrefs.GetInt("Level4Unlocked") != 4)
{
PlayerPrefs.SetInt("Level4Unlocked", 4);
}
}
break;
}
}
}