using System.Collections; using System.Collections.Generic; using UnityEngine; public class WolfActGridCell : MonoBehaviour { public Vector3 pos; void OnDestroy() { if (!WolfActGrid.ins) return; List> matrix = WolfActGrid.ins.areaMatrix.posMatrix; for (int r = matrix.Count - 1; r >=0 ; r--) { List row = matrix[r]; for (int c = row.Count - 1; c >=0 ; c--) { Vector3 p = row[c]; if (p.Equals(pos)) { row.RemoveAt(c); Debug.LogWarning($"网格单元{gameObject.name}移除成功"); } } } } }