Skip to content

Commit 6786b5c

Browse files
committed
Fix new LSBody updating bugs
1 parent 3d76719 commit 6786b5c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Core/Simulation/Grid/Utility/Tools/Blocker/Blocker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected override void OnLateInitialize()
1919
{
2020
base.OnInitialize();
2121

22-
CachedBody = this.GetComponent<LSBody> ();
22+
CachedBody = this.GetComponent<UnityLSBody> ().InternalBody;
2323

2424
if (this.BlockPathfinding) {
2525
const long gridSpacing = FixedMath.One;

Core/Simulation/Physics/Core/Legacy/Editor/LegacyEditorLSBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void ReplaceLegacy ()
5252
var legacy = fab.GetComponent<LSBody> ();
5353
legacy.Replace ();
5454
DestroyImmediate (legacy);
55-
PrefabUtility.ReplacePrefab(fab, source);
55+
PrefabUtility.MergeAllPrefabInstances(source);
5656
GameObject.DestroyImmediate(fab);
5757
}
5858

Core/Simulation/Physics/Core/UnityLSBody.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public void Initialize(Vector3d StartPosition, Vector2d StartRotation, bool isDy
1919
{
2020
if (_internalBody.IsNull())
2121
_internalBody = new LSBody();
22+
InternalBody.transform = transform;
23+
InternalBody.Reset();
2224
InternalBody.Initialize (StartPosition,StartRotation,isDynamic);
2325
}
2426

0 commit comments

Comments
 (0)