27 lines
873 B
C#
27 lines
873 B
C#
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
|
|
}
|
|
}
|