init
This commit is contained in:
commit
bd5b1556ff
269 changed files with 6249829 additions and 0 deletions
20
Assets/Scripts/CheckPoint.cs
Normal file
20
Assets/Scripts/CheckPoint.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CheckPoint : MonoBehaviour{
|
||||
|
||||
public Transform checkpointPos;
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
if (col.CompareTag("Player")){
|
||||
col.GetComponent<PlayerController>().lastCheckpoint = checkpointPos.position;
|
||||
}
|
||||
}
|
||||
|
||||
void OnDrawGizmos(){
|
||||
Gizmos.color = Color.green;
|
||||
BoxCollider2D col = GetComponent<BoxCollider2D>();
|
||||
Gizmos.DrawWireCube(col.transform.position, col.size);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue