Skip to content

Commit

Permalink
Upgrade Unity version and fixed a collider bug
Browse files Browse the repository at this point in the history
Upgrade Unity version and fixed a collider bug
  • Loading branch information
0x7c13 committed Jul 18, 2024
1 parent ad84445 commit 8433938
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ protected override void OnFixedUpdateGameEntity(float fixedDeltaTime)
// Sanity cleanup
if (_activeColliders.Count > 0)
{
_activeColliders.RemoveWhere(_ => _.ColliderGameEntity == null || _.ColliderGameEntity.IsNativeObjectDisposed);
_activeColliders.RemoveWhere(_ => _.ColliderGameEntity == null ||
_.ColliderGameEntity.IsNativeObjectDisposed ||
// Just in case the collider is destroyed during the collision
_.ColliderGameEntity.GetComponent<Collider>() == null);
}

// Sanity cleanup
Expand Down Expand Up @@ -975,8 +978,26 @@ public void Execute(ActorSetNavLayerCommand command)

public void Execute(ActorActivateCommand command)
{
if (_actor.Id != command.ActorId) return;
if (command.IsActive == 0)
// Manually remove the active actor collider when it is being deactivated by script if any
if (_activeColliders.Count > 0 && command.IsActive == 0)
{
ActiveColliderInfo colliderToBeRemoved = null;

foreach (ActiveColliderInfo colliderInfo in _activeColliders)
{
if (colliderInfo.ColliderGameEntity.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Id == command.ActorId)
{
colliderToBeRemoved = colliderInfo;
break;
}
}

if (colliderToBeRemoved != null) _activeColliders.Remove(colliderToBeRemoved);
}

// When self is being deactivated, cancel the movement
if (_actor.Id == command.ActorId && command.IsActive == 0)
{
_movementWaiter?.CancelWait();
_movementCts?.Cancel();
Expand Down
12 changes: 6 additions & 6 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
"com.unity.ai.navigation": "1.1.5",
"com.unity.feature.development": "1.0.1",
"com.unity.ide.rider": "3.0.28",
"com.unity.ide.rider": "3.0.31",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.vscode": "1.2.5",
"com.unity.inputsystem": "1.7.0",
"com.unity.memoryprofiler": "1.1.0",
"com.unity.mobile.android-logcat": "1.4.0",
"com.unity.mobile.android-logcat": "1.4.2",
"com.unity.postprocessing": "3.4.0",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.8",
"com.unity.textmeshpro": "3.0.9",
"com.unity.timeline": "1.7.6",
"com.unity.toolchain.macos-x86_64-linux-x86_64": "2.0.6",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.6",
"com.unity.toolchain.macos-x86_64-linux-x86_64": "2.0.9",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.9.2",
"com.unity.visualscripting": "1.9.4",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
28 changes: 14 additions & 14 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"source": "builtin",
"dependencies": {
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.rider": "3.0.28",
"com.unity.ide.rider": "3.0.31",
"com.unity.ide.vscode": "1.2.5",
"com.unity.editorcoroutines": "1.0.0",
"com.unity.performance.profile-analyzer": "1.2.2",
Expand All @@ -45,7 +45,7 @@
}
},
"com.unity.ide.rider": {
"version": "3.0.28",
"version": "3.0.31",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -88,7 +88,7 @@
"url": "https://packages.unity.com"
},
"com.unity.mobile.android-logcat": {
"version": "1.4.0",
"version": "1.4.2",
"depth": 0,
"source": "registry",
"dependencies": {},
Expand Down Expand Up @@ -118,18 +118,18 @@
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "2.0.7",
"version": "2.0.10",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "2.0.6",
"version": "2.0.9",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.7"
"com.unity.sysroot": "2.0.10"
},
"url": "https://packages.unity.com"
},
Expand All @@ -155,7 +155,7 @@
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.8",
"version": "3.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -176,22 +176,22 @@
"url": "https://packages.unity.com"
},
"com.unity.toolchain.macos-x86_64-linux-x86_64": {
"version": "2.0.6",
"version": "2.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.7",
"com.unity.sysroot.linux-x86_64": "2.0.6"
"com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9"
},
"url": "https://packages.unity.com"
},
"com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "2.0.6",
"version": "2.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.7",
"com.unity.sysroot.linux-x86_64": "2.0.6"
"com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9"
},
"url": "https://packages.unity.com"
},
Expand All @@ -205,7 +205,7 @@
}
},
"com.unity.visualscripting": {
"version": "1.9.2",
"version": "1.9.4",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ PlayerSettings:
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
metalCompileShaderBinary: 0
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID: 4997CKN8MT
Expand Down Expand Up @@ -1014,6 +1015,7 @@ PlayerSettings:
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenUseBackgroundColor: 0
syncCapabilities: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}
metroFTAName:
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2022.3.22f1
m_EditorVersionWithRevision: 2022.3.22f1 (887be4894c44)
m_EditorVersion: 2022.3.38f1
m_EditorVersionWithRevision: 2022.3.38f1 (c5d5a7410213)

0 comments on commit 8433938

Please sign in to comment.