muffin v7.38.9
This commit is contained in:
parent
ada27cf05b
commit
8a7847ff37
21 changed files with 1296 additions and 689 deletions
|
|
@ -39,6 +39,10 @@ internal sealed class NavmeshIpc
|
|||
|
||||
private readonly ICallGateSubscriber<float> _buildProgress;
|
||||
|
||||
private readonly ICallGateSubscriber<bool> _navReload;
|
||||
|
||||
private readonly ICallGateSubscriber<bool> _navRebuild;
|
||||
|
||||
public bool IsReady
|
||||
{
|
||||
get
|
||||
|
|
@ -115,6 +119,8 @@ internal sealed class NavmeshIpc
|
|||
_queryPointOnFloor = pluginInterface.GetIpcSubscriber<Vector3, bool, float, Vector3?>("vnavmesh.Query.Mesh.PointOnFloor");
|
||||
_queryNearestPoint = pluginInterface.GetIpcSubscriber<Vector3, float, float, Vector3?>("vnavmesh.Query.Mesh.NearestPoint");
|
||||
_buildProgress = pluginInterface.GetIpcSubscriber<float>("vnavmesh.Nav.BuildProgress");
|
||||
_navReload = pluginInterface.GetIpcSubscriber<bool>("vnavmesh.Nav.Reload");
|
||||
_navRebuild = pluginInterface.GetIpcSubscriber<bool>("vnavmesh.Nav.Rebuild");
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
|
|
@ -129,6 +135,30 @@ internal sealed class NavmeshIpc
|
|||
}
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
{
|
||||
try
|
||||
{
|
||||
_navReload.InvokeFunc();
|
||||
}
|
||||
catch (IpcError exception)
|
||||
{
|
||||
_logger.LogWarning(exception, "Could not reload navmesh");
|
||||
}
|
||||
}
|
||||
|
||||
public void Rebuild()
|
||||
{
|
||||
try
|
||||
{
|
||||
_navRebuild.InvokeFunc();
|
||||
}
|
||||
catch (IpcError exception)
|
||||
{
|
||||
_logger.LogWarning(exception, "Could not rebuild navmesh");
|
||||
}
|
||||
}
|
||||
|
||||
public Task<List<Vector3>> Pathfind(Vector3 localPlayerPosition, Vector3 targetPosition, bool fly, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
|
|
@ -147,8 +177,8 @@ internal sealed class NavmeshIpc
|
|||
{
|
||||
try
|
||||
{
|
||||
_pathSetTolerance.InvokeAction(0.25f);
|
||||
return _pluginInterface.GetIpcSubscriber<Vector3, Vector3, bool, float, CancellationToken, Task<List<Vector3>>>("vnavmesh.Nav.PathfindWithTolerance").InvokeFunc(localPlayerPosition, targetPosition, fly, tolerance, cancellationToken);
|
||||
_pathSetTolerance.InvokeAction(tolerance);
|
||||
return _pluginInterface.GetIpcSubscriber<Vector3, Vector3, bool, float, Task<List<Vector3>>>("vnavmesh.Nav.PathfindWithTolerance").InvokeFunc(localPlayerPosition, targetPosition, fly, tolerance);
|
||||
}
|
||||
catch (IpcError exception)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue