| 1234567891011121314151617181920212223242526 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class WolfActGridCell : MonoBehaviour
- {
- public Vector3 pos;
- void OnDestroy()
- {
- if (!WolfActGrid.ins) return;
- List<List<Vector3>> matrix = WolfActGrid.ins.areaMatrix.posMatrix;
- for (int r = matrix.Count - 1; r >=0 ; r--)
- {
- List<Vector3> 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}移除成功");
- }
- }
- }
- }
- }
|