public void Bake(NavMeshBuildDebugSettings debug) { var sources = CollectSources(); // Use unscaled bounds - this differs in behaviour from e.g. collider components. // But is similar to reflection probe - and since navmesh data has no scaling support - it is the right choice here var sourcesBounds = new Bounds(m_Center, Abs(m_Size)); if (m_CollectObjects == CollectObjects.All || m_CollectObjects == CollectObjects.Children) { sourcesBounds = CalculateWorldBounds(sources); } var data = NavMeshBuilder.BuildNavMeshData(GetBuildSettings(), sources, sourcesBounds, transform.position, transform.rotation, debug); if (data != null) { data.name = gameObject.name; RemoveData(); m_BakedNavMeshData = data; AddData(); } }
private static bool UpdateNavMeshDataListInternal(NavMeshData data, NavMeshBuildSettings buildSettings, object sources, Bounds localBounds, NavMeshBuildDebugSettings debug) { return(INTERNAL_CALL_UpdateNavMeshDataListInternal(data, ref buildSettings, sources, ref localBounds, ref debug)); }
private static bool UpdateNavMeshData(NavMeshData data, NavMeshBuildSettings buildSettings, List <NavMeshBuildSource> sources, Bounds localBounds, NavMeshBuildDebugSettings debug) { if (data == null) { throw new ArgumentNullException("data"); } if (sources == null) { throw new ArgumentNullException("sources"); } return(UpdateNavMeshDataListInternal(data, buildSettings, sources, localBounds, debug)); }
private static NavMeshData BuildNavMeshData(NavMeshBuildSettings buildSettings, List <NavMeshBuildSource> sources, Bounds localBounds, Vector3 position, Quaternion rotation, NavMeshBuildDebugSettings debug) { if (sources == null) { throw new ArgumentNullException("sources"); } NavMeshData navMeshData = new NavMeshData(buildSettings.agentTypeID); navMeshData.position = position; navMeshData.rotation = rotation; UpdateNavMeshDataListInternal(navMeshData, buildSettings, sources, localBounds, debug); return(navMeshData); }
private static extern AsyncOperation INTERNAL_CALL_UpdateNavMeshDataAsyncListInternal(NavMeshData data, ref NavMeshBuildSettings buildSettings, object sources, ref Bounds localBounds, ref NavMeshBuildDebugSettings debug);
private static AsyncOperation UpdateNavMeshDataAsyncListInternal(NavMeshData data, NavMeshBuildSettings buildSettings, object sources, Bounds localBounds, NavMeshBuildDebugSettings debug) { return(NavMeshBuilder.INTERNAL_CALL_UpdateNavMeshDataAsyncListInternal(data, ref buildSettings, sources, ref localBounds, ref debug)); }