Skip to content

Commit

Permalink
Fix NullReferenceException on subsequent runs
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurkehrwald committed Oct 31, 2024
1 parent 3e5782d commit bfee7f3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class PhysicsEngine : MonoBehaviour
[NonSerialized] private NativeColliders _kinematicCollidersAtIdentity;
[NonSerialized] private NativeParallelHashMap<int, NativeColliderIds> _kinematicColliderLookups;
[NonSerialized] private NativeArray<PhysicsEnv> _physicsEnv = new(1, Allocator.Persistent);
[NonSerialized] private NativeQueue<EventData> _eventQueue = new(Allocator.Persistent);
[NonSerialized] private NativeQueue<EventData> _eventQueue;

[NonSerialized] private NativeParallelHashMap<int, BallState> _ballStates = new(0, Allocator.Persistent);
[NonSerialized] private NativeParallelHashMap<int, BumperState> _bumperStates = new(0, Allocator.Persistent);
Expand Down Expand Up @@ -170,6 +170,7 @@ internal void DisableCollider(int itemId)

private void Awake()
{
_eventQueue = new(Allocator.Persistent);
_player = GetComponentInParent<Player>();
_insideOfs = new InsideOfs(Allocator.Persistent);
_physicsEnv[0] = new PhysicsEnv(NowUsec, GetComponentInChildren<PlayfieldComponent>(), GravityStrength);
Expand Down

0 comments on commit bfee7f3

Please sign in to comment.