init
This commit is contained in:
commit
001bb14f16
951 changed files with 270074 additions and 0 deletions
27
Assets/Scripts/Level/CheckPointManager.cs
Normal file
27
Assets/Scripts/Level/CheckPointManager.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CheckPointManager : MonoBehaviour{
|
||||
|
||||
public GameObject[] checkPoints;
|
||||
public LightBar lightBar;
|
||||
public Transform player;
|
||||
|
||||
int checkPoint;
|
||||
int time;
|
||||
|
||||
void Start(){
|
||||
if (PlayerPrefs.HasKey("CheckPoint")){
|
||||
PlayerPrefs.GetInt("CheckPoint", checkPoint);
|
||||
player.position = new Vector3(checkPoints[checkPoint].transform.position.x, checkPoints[checkPoint].transform.position.y - 1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
for (int i = 0; i < checkPoints.Length; i++){
|
||||
checkPoints[i].GetComponent<CheckPoint>().checkPointNumber = i;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue