Skip to content

MLAPI after setting up game for Unit Tests #704

Closed
@benlabbeus

Description

@benlabbeus

I'm attempting to setup a PlayMode Unit Test using Test Runner.

UPDATE: Downgrading to Unity 2019 resolves.

Describe the bug
Field `MLAPI.NetworkManager:__ntable' is inaccessible from a Unity Assembly Definition

To Reproduce
In a simple scene using MLAPI with a NetworkManager and a NetworkObject -

  1. Open Test Runner
  2. Create a PlayMode Test Assembly Folder
  3. Create Test Script in current Folder
  4. From the Project window, Create a Assembly Definition, name it "Scripts"
  5. On the new "Scripts" Assembly definition Add com,unity.multiplayer.mlapi.runtime as a Assembly Definition Reference
  6. Run, you'll then get the error -
    FieldAccessException: Field MLAPI.NetworkManager:__ntable' is inaccessible from method xxxx.xxxx:.cctor ()'

Rethrow as TypeInitializationException: The type initializer for 'xxxx.xxxx' threw an exception.

Deleting the "Scripts" Assembly Definition returns things to working order.

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.3.2.f1
  • MLAPI Version: 0.1.0
  • MLAPI Commit:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions