本文整理汇总了C#中GridCell.Add方法的典型用法代码示例。如果您正苦于以下问题:C# GridCell.Add方法的具体用法?C# GridCell.Add怎么用?C# GridCell.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridCell
的用法示例。
在下文中一共展示了GridCell.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchSceneData
private void FetchSceneData()
{
List<SceneData> new_scene_data = new List<SceneData>();
//using (new Nav.Profiler("[Nav.D3.Navigation] Navmesh data aquired [{t}]", 70))
{
foreach (Enigma.D3.Scene scene in m_Engine.ObjectManager.x998_Scenes.Dereference())
{
if (scene == null || scene.x000_Id < 0)
continue;
SceneData scene_data = new SceneData(scene);
if (m_AllowedAreasSnoId.Count > 0 && !m_AllowedAreasSnoId.Contains(scene_data.AreaSnoId) && !m_AllowedGridCellsId.Contains(scene_data.SceneSnoId))
continue;
if (m_ProcessedSceneId.Contains(scene_data.SceneUid))
continue;
new_scene_data.Add(scene_data);
}
}
//using (new Nav.Profiler("[Nav.D3.Navigation] Navmesh data added [{t}]"))
{
int grid_cells_added = 0;
foreach (SceneData scene_data in new_scene_data)
{
SceneSnoNavData sno_nav_data = null;
// allow empty grids
m_SnoCache.TryGetValue(scene_data.SceneSnoId, out sno_nav_data);
GridCell grid_cell = new GridCell(scene_data.Min, scene_data.Max, scene_data.SceneSnoId, scene_data.AreaSnoId);
grid_cell.UserData = scene_data.AreaSnoId;
if (sno_nav_data != null)
{
int cell_id = 0;
foreach (Cell cell in sno_nav_data.Cells)
grid_cell.Add(new Cell(cell.Min + scene_data.Min, cell.Max + scene_data.Min, cell.Flags, cell_id++));
}
if (Add(grid_cell, false))
++grid_cells_added;
m_ProcessedSceneId.Add(scene_data.SceneUid);
}
if (grid_cells_added > 0)
{
Log("[Nav.D3] " + grid_cells_added + " grid cells added" + (Explorator == null ? " (EXPLORATOR NOT PRESENT!!!)" : "") + ".");
if (Explorator != null)
Explorator.OnNavDataChange();
}
}
}