Cannot implement Buffer,Buffer interfaces at the same time

@CMarastoni @timjohansson I try to drop the 2 script files (see attached files) into dots netcode project I will get the following error. It seems like u will only get this error when u have dots netcode package. Any idea how to fix it?

Edit: Seems like in dots netcode project, using generic type dynamic buffer will throw error. Can u point me which part of dots netcode code to fix it if it’s possible?

Microsoft (R) Visual C# Compiler version 3.8.0-dev.20527.1 (53dc6556)
Copyright (C) Microsoft Corporation. All rights reserved.
error NetCode: struct Unity.Physics.Stateful.StatefulCollisionEvent cannot implement Buffer,Buffer interfaces at the same time
error NetCode: struct Unity.Physics.Stateful.StatefulTriggerEvent cannot implement Buffer,Buffer interfaces at the same time

8009738–1030991–1.zip (1.61 KB)

@CMarastoni @timjohansson I uploaded the script files for u to repro the error.

I can repo the error but the fix is very easy as well.

public struct StatefulCollisionEvent :IBufferElementData, IStatefulSimulationEvent

to

public struct StatefulCollisionEvent : IStatefulSimulationEvent

Doesn’t like implementing the same interface twice for some reason.

4 Likes

Does this not cause any unexpected behavior?

No, IStatefulSimulationEvent inherits from IBufferElementData

1 Like

Thank you!