Initial Unity 6 scaffold for Cat Kirby Adventures.
Add Phase A greybox vertical slice: third-person movement, forest path, checkpoints, story triggers, and light ability gate.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace KirbyAdventures
|
||||
{
|
||||
[RequireComponent(typeof(Collider))]
|
||||
public class Checkpoint : MonoBehaviour
|
||||
{
|
||||
public Transform SpawnPoint;
|
||||
public string CheckpointId = "cp";
|
||||
|
||||
void Reset()
|
||||
{
|
||||
var c = GetComponent<Collider>();
|
||||
if (c != null) c.isTrigger = true;
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (!other.CompareTag("Player") && other.GetComponent<PlayerMotor>() == null)
|
||||
return;
|
||||
|
||||
var point = SpawnPoint != null ? SpawnPoint : transform;
|
||||
CheckpointSystem.SetCheckpoint(point.position, point.rotation, CheckpointId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user