srcnalt / OpenAI-Unity

An unofficial OpenAI Unity Package that aims to help you use OpenAI API directly in Unity Game engine.
MIT License
672 stars 150 forks source link

Conflict between PlasticSCM and srcnalt.openAI-Unity #16

Closed Miaopus closed 1 year ago

Miaopus commented 1 year ago

Here is the bug report in detail.

\Library/PackageCache/com.srcnalt.openai-unity@ef49d3baf3/Runtime/Configuration.cs(14,26): error CS0433: The type 'JsonSerializerSettings' exists in both 'Newtonsoft.Json.Net20, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

Library/PackageCache/com.srcnalt.openai-unity@ef49d3baf3/Runtime/OpenAIApi.cs(45,26): error CS0433: The type 'JsonSerializerSettings' exists in both 'Newtonsoft.Json.Net20, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

Miaopus commented 1 year ago

When I import PlasticSCM to my project with srcnalt.openAI-Unity, it caused the bug that "The type 'JsonSerializerSettings' exists in both 'Newtonsoft.Json.Net20, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'"

srcnalt commented 1 year ago

Hi @Miaopus, does this also happen when you run or build the project? This package contains com.unity.nuget.newtonsoft-json version 3.0.2 as a dependency, maybe another package or the project itself has another version of newtonsoft in it and that is causing problem in PlasticSCM.

Miaopus commented 1 year ago
截屏2023-02-21 18 14 53
Miaopus commented 1 year ago

Yes, it happens when I open my unity project.

Miaopus commented 1 year ago

But actually, before I imported PlasticSCM, the project works well.

srcnalt commented 1 year ago

You can import PlasticSCM via Version Control package of Unity, it comes as a dependency. I suppose you import it via a unity package which brings newtonsoft DLLs along with it and causes the issue. Or you can go to PlasticSCM folder where youimported it and remove newtonsoft related libraries.

https://docs.unity3d.com/Manual/PlasticSCMPlugin.html