mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提取RVO 寻路
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Game.Plugins.App
|
||||
|
||||
public static readonly JNGSocket Socket = new JNGSocket();
|
||||
public static readonly JNGSyncFrame Sync = new JNGSyncFrame();
|
||||
public static readonly JAPI Api = new(new JAPIConfig(){BaseURL = "http://127.0.0.1:8080"});
|
||||
public static readonly JAPI Api = new(new JAPIConfig(){BaseURL = "http://192.168.0.116:8080"});
|
||||
public static readonly EventDispatcher Event = EventDispatcher.Event;
|
||||
|
||||
public static SystemBase[] System()
|
||||
|
3
JNFrame/Assets/Game/Plugins/App/Game/RVO.meta
Normal file
3
JNFrame/Assets/Game/Plugins/App/Game/RVO.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78fd52a1d23c49618d1da7e84e276adc
|
||||
timeCreated: 1707121689
|
28
JNFrame/Assets/Game/Plugins/App/Game/RVO/JNGRVOManager.cs
Normal file
28
JNFrame/Assets/Game/Plugins/App/Game/RVO/JNGRVOManager.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Game.Plugins.App.Sync;
|
||||
using Game.Plugins.JNGame.Sync.Frame.AstarPath.RVO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Plugins.App.Game.RVO
|
||||
{
|
||||
//RVO 寻路
|
||||
public class JNGRVOManager : JNGSyncFrameDefault
|
||||
{
|
||||
|
||||
private JNRVOSimulator _simulator = new JNRVOSimulator(MovementPlane.XY);
|
||||
public JNRVOSimulator Simulator => _simulator;
|
||||
|
||||
public override void OnSyncLoad()
|
||||
{
|
||||
base.OnSyncLoad();
|
||||
}
|
||||
|
||||
public override void OnSyncUpdate(int dt, JNFrameInfo frame, Object input)
|
||||
{
|
||||
base.OnSyncUpdate(dt, frame, input);
|
||||
Simulator.DesiredDeltaTime = 1.0f / (1000f / dt);
|
||||
Simulator.symmetryBreakingBias = 0.1f;
|
||||
//更新寻路
|
||||
Simulator.Update();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ed6c9606e7b4be7844512656ed3b2cd
|
||||
timeCreated: 1707121704
|
@@ -8,7 +8,7 @@ namespace Game.Plugins.App
|
||||
protected override async UniTask<string> GetUrl()
|
||||
{
|
||||
await UniTask.NextFrame();
|
||||
return "ws://127.0.0.1:8080/websocket";
|
||||
return "ws://192.168.0.116:8080/websocket";
|
||||
}
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@ namespace Game.Plugins.App.Sync
|
||||
}
|
||||
|
||||
public override void OnSyncLoad(){}
|
||||
public override void OnSyncStart(){}
|
||||
public override void OnSyncUpdate(int dt, JNFrameInfo frame, T input)
|
||||
{
|
||||
|
||||
|
@@ -8,6 +8,12 @@ namespace Game.Plugins.App.Sync
|
||||
public override void OnSyncUpdate(int dt, JNFrameInfo frame, Object input)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnLateSyncUpdate(int dt, JNFrameInfo frame, Object input)
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user