void OnEnable() { generator = new SerializedObject(target); m_mapDisplay = (AStarMapCellDisplay)target; m_mapDisplay.Init(); IsToLeft = generator.FindProperty("IsToLeft"); IsToRight = generator.FindProperty("IsToRight"); IsToUp = generator.FindProperty("IsToUp"); IsToDown = generator.FindProperty("IsToDown"); IsToLeftUp = generator.FindProperty("IsToLeftUp"); IsToLeftDown = generator.FindProperty("IsToLeftDown"); IsToRightUp = generator.FindProperty("IsToRightUp"); IsToRightDown = generator.FindProperty("IsToRightDown"); IsAllOpen = generator.FindProperty("IsAllOpen"); IsAllClose = generator.FindProperty("IsAllClose"); IsObstacle = generator.FindProperty("IsObstacle"); }
public void Recreate(GameObject curSel) { AStarMapCellDisplay mcd = curSel.GetComponent <AStarMapCellDisplay>(); int col = -1; int row = -1; if (mcd != null) { col = mcd.Column; row = mcd.Row; } MapCatch(); ClearMap(); ReadCatch(); if (col >= 0 && row >= 0) { Selection.activeGameObject = m_cellArray[col, row].gameObject; } }