rt.筆記備查.
Q.Runtime下動態更新navmesh所生成的RecastMesh相關的配置項引數:
放置NavVolume後會動態生成recastmesh物件
如果需要在runtime模式下實時動態更新修改與修改可以參照下例:
UNavigationSystemV1 *subSys = UNavigationSystemV1::GetNavigationSystem(World); for (ANavigationData* data :subSys->NavDataSet) { if(auto recast = Cast<ARecastNavMesh>(data)) { { //例子測試,隨機設定AgentRadius[50,100] recast->AgentRadius = FMath::RandRange(50,100); } //重新計算當前recast recast->RebuildAll(); ///重新計算指定Box區域的Namesh //recast->RebuildDirtyAreas(); //更新回撥委託 //recast->OnNavMeshUpdate } } //從新重新整理全部的NavDataSet //UNavigationSystemV1::GetNavigationSystem(World)->Build(); //生成完畢後的回撥.會傳入完成的NavDataSet //subSys->OnNavigationGenerationFinishedDelegate