private void SetMapAreaBlock(MapAreaCtrl areaCtrl) { Vector2Int _pos = areaCtrl.Order; _pos = _pos + Vector2Int.one * 4; for (int i = 0; i < mapAreaSize.y; i++) { for (int j = 0; j < mapAreaSize.x; j++) { areaCtrl.mapblock[i, j] = mapblocks[i + _pos.y * 25, j + _pos.x * 25]; } } }
/// <summary> /// 初始化MapAreaCtrl /// </summary> public void CreatMapArea() { mapAreas = new MapAreaCtrl[9]; for (int i = 0; i < 9; i++) { GameObject _obj = new GameObject(); _obj.name = "mapArea_" + i; _obj.transform.SetParent(transform); MapAreaCtrl _mapArea = _obj.AddComponent <MapAreaCtrl>(); mapAreas[i] = _mapArea; _mapArea.Initialized(); } }
private void ChangeMapCenter(MapAreaCtrl mapArea) { Vector2Int _pos = mapArea.Order + Vector2Int.one * 5; }