32 lines
537 B
C#
32 lines
537 B
C#
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);
|
|
}
|
|
}
|
|
}
|