备份CatanBuilding瘦身独立工程
This commit is contained in:
44
Assets/Scripts/HexGrid/HexZoneController.cs
Normal file
44
Assets/Scripts/HexGrid/HexZoneController.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace HexGrid
|
||||
{
|
||||
public class HexZoneController : MonoBehaviour,IZoneController
|
||||
{
|
||||
//
|
||||
private HexZone _zoneData;
|
||||
private IBuildMediator _buildMediator;
|
||||
private void Awake()
|
||||
{
|
||||
Log("Awake()-> ");
|
||||
}
|
||||
private static void Log(object t)
|
||||
{
|
||||
Debug.Log($"<color=yellow>HexZoneController -> {t} </color>");
|
||||
}
|
||||
|
||||
public void LoadData(HexZone zoneData)
|
||||
{
|
||||
_zoneData = zoneData;
|
||||
}
|
||||
|
||||
public void UpdateZoneStatus()
|
||||
{
|
||||
Log("UpdateZoneStatus() -> ");
|
||||
}
|
||||
|
||||
public void OnHexCellClicked(HexTile tiler)
|
||||
{
|
||||
Log($"OnHexCellClicked -> {tiler}");
|
||||
|
||||
var tiles = _zoneData.tiles;
|
||||
foreach (var tileData in tiles.Where(tileData => tileData.tileId == tiler.tileId))
|
||||
{
|
||||
tileData.tileStatus = tiler.tileStatus;
|
||||
break;
|
||||
}
|
||||
// _buildMediator?.CheckForBuilding(_zoneData.subZones);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user