增加传送门

This commit is contained in:
2026-07-05 22:11:50 +08:00
parent 33282c3d83
commit b7aac301ba
17 changed files with 5648 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
using UnityEngine;
using GameFramework;
/// <summary>
/// 传送门/出口 Door —— 玩家碰触后触发胜利流程。
/// 挂载在 Door 预制体根对象上,Collider 设为 Trigger。
/// </summary>
public class DoorPortal : MonoBehaviour
{
void Awake()
{
var col = GetComponent<Collider>();
if (col != null) col.isTrigger = true;
}
void OnTriggerEnter(Collider other)
{
if (!other.CompareTag("Player")) return;
Debug.Log("[DoorPortal] 玩家进入传送门,触发胜利!");
GameManager.Win();
}
}