*
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class Checkpoint : MonoBehaviour {
|
||||
public bool isChecked = false;
|
||||
public bool checkOnce = true;
|
||||
public CheckpointManager manager;
|
||||
|
||||
void OnTriggerEnter (Collider other) {
|
||||
if (checkOnce && isChecked) {
|
||||
return;
|
||||
}
|
||||
isChecked = true;
|
||||
BallController ball = other.GetComponent<BallController> ();
|
||||
if (ball != null && manager != null) {
|
||||
manager.OnCheckPoint(this);
|
||||
}
|
||||
}
|
||||
|
||||
void OnDrawGizmos(){
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user