本文整理汇总了C#中ImageMap.GetCellDimensions方法的典型用法代码示例。如果您正苦于以下问题:C# ImageMap.GetCellDimensions方法的具体用法?C# ImageMap.GetCellDimensions怎么用?C# ImageMap.GetCellDimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMap
的用法示例。
在下文中一共展示了ImageMap.GetCellDimensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildGrid
public void BuildGrid()
{
var grid = PointyHexGrid<UVCell>.ThinRectangle(11, 11);
var baseMap = new PointyHexMap(cellPrefab.Dimensions * 1.1f);
Debug.Log(cellPrefab.Dimensions);
var cellMap = baseMap
.WithWindow(ExampleUtils.ScreenRect)
.AlignMiddleCenter(grid)
.To3DXY();
var imageMap =
new ImageMap<PointyHexPoint>(new Rect(0, 0, 1, 1), grid, baseMap);
foreach (var point in grid)
{
var worldPosition = cellMap[point];
var cell = Instantiate(cellPrefab);
Debug.Log(cell.Dimensions);
cell.transform.parent = gridRoot.transform;
cell.transform.localScale = Vector3.one;
cell.transform.localPosition = worldPosition;
cell.SetTexture(texture);
cell.name = point.ToString();
var imagePoint = imageMap[point];
cell.SetUVs(imagePoint, imageMap.GetCellDimensions(point));
}
}