You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.8 KiB
62 lines
1.8 KiB
3 years ago
|
using UnityEngine;
|
||
|
using UnityEngine.AI;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
public struct RectIndices
|
||
|
{
|
||
|
public int startRow;
|
||
|
public int endRow;
|
||
|
public int startCol;
|
||
|
public int endCol;
|
||
|
}
|
||
|
|
||
|
[ComponentOf(typeof(Scene))]
|
||
|
public class MapComponent : Entity, IAwake
|
||
|
{
|
||
|
public NavMeshSurface2d NavMesh2d;
|
||
|
// 山谷内部地图信息
|
||
|
public Vector3 MapMinPos = Vector3.zero;
|
||
|
public Vector3 MapMaxPos= Vector3.zero;
|
||
|
public Vector2 MapSize;
|
||
|
public float TileMapWidth;
|
||
|
public float TileMapHeight;
|
||
|
public float HalfTileMapWidth;
|
||
|
public float HalfTileMapHeight;
|
||
|
|
||
|
// 山谷内部可放置位置信息
|
||
|
public Vector3 AvalablePlaceMinPos = Vector3.zero;
|
||
|
public Vector2 AvalablePlaceSize;
|
||
|
|
||
|
// 占用位置二维数组
|
||
|
public int MaxTileX;
|
||
|
public int MaxTileY;
|
||
|
public bool[,] OccupyPlaceMap;
|
||
|
|
||
|
|
||
|
// 所有建筑根节点
|
||
|
public Transform BuildingRoot;
|
||
|
// 所有人物根节点
|
||
|
public Transform PeopleRoot;
|
||
|
// 所有资源根节点
|
||
|
public Transform ResourceRoot;
|
||
|
|
||
|
public float TileWidth = 1.0f;
|
||
|
public float TileHeight = 0.5f;
|
||
|
public float HalfTileWidth = 0.5f;
|
||
|
public float HalfTileHeight = 0.25f;
|
||
|
|
||
|
// 土地网格指示
|
||
|
public MeshFilter GridMeshFilter;
|
||
|
public Mesh GridMesh;
|
||
|
|
||
|
// 占用面积提示器
|
||
|
public MeshRenderer OccupyPlaceIndicatorMR;
|
||
|
public GameObject OccupyPlaceInidcator;
|
||
|
public Color ValidColor = new Color(0, 1, 0, 0.5f);
|
||
|
public Color InvalidColor = new Color(1, 0, 0, 0.5f);
|
||
|
|
||
|
// 更新建筑信息
|
||
|
public long UpdateBuildingDataTimer;
|
||
|
}
|
||
|
}
|