多轮审查和修复
This commit is contained in:
26
Assets/Scripts/World/MagicWall.cs
Normal file
26
Assets/Scripts/World/MagicWall.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BaseGames.World
|
||||
{
|
||||
/// <summary>
|
||||
/// 魔法墙标记组件。仅用于 Gizmo 可视化,穿越逻辑通过
|
||||
/// Physics Layer Matrix 实现(Ghost 层 vs MagicWall 层 = IgnoreCollision)。
|
||||
/// SkillManager 在太虚斩激活/结束时切换玩家 Layer(Ghost ↔ Player)。
|
||||
/// </summary>
|
||||
[ExecuteAlways]
|
||||
public class MagicWall : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Color _normalColor = new Color(0.4f, 0.2f, 1f, 0.8f);
|
||||
[SerializeField] private Color _ghostColor = new Color(0.4f, 0.2f, 1f, 0.15f);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
Gizmos.color = _normalColor;
|
||||
var col = GetComponent<Collider2D>();
|
||||
if (col != null)
|
||||
Gizmos.DrawWireCube(transform.position, col.bounds.size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user