45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Gameplay.Building.Camp
|
|
{
|
|
/// <summary>
|
|
/// 营地建筑单位
|
|
/// </summary>
|
|
public class CampBuildUnit
|
|
{
|
|
/// <summary>
|
|
/// 建筑prefab
|
|
/// </summary>
|
|
public GameObject GoBuild
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 格子偏移列表(行,列),以指针格子为中心,计算出该建筑的需要的格子位置
|
|
/// </summary>
|
|
public Vector2Int[] GridOffsets
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 格子索引(放置在地图中的该建组中心格子索引)
|
|
/// </summary>
|
|
public int CellIndex
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public CampBuildUnit(GameObject go, params Vector2Int[] gridOffsets)
|
|
{
|
|
GridOffsets = gridOffsets;
|
|
GoBuild = go;
|
|
}
|
|
}
|
|
} |