add project files
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Checkpoints : CoreBehaviour
|
||||
{
|
||||
private Animator anim;
|
||||
|
||||
public bool isPass { get; private set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
InstantiatePrefab();
|
||||
}
|
||||
|
||||
private void InstantiatePrefab()
|
||||
{
|
||||
GameObject instance = UnityEngine.Object.Instantiate(base.CoreDef.GetProgression().Checkpoints, base.transform);
|
||||
if (instance != null)
|
||||
{
|
||||
anim = instance.GetComponent<Animator>();
|
||||
}
|
||||
}
|
||||
|
||||
public void PassCheckpoint()
|
||||
{
|
||||
isPass = true;
|
||||
if (anim != null)
|
||||
{
|
||||
anim.SetBool("Pass", value: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user