How to debug unity classlibrary?

Answered

You answer my question https://rider-support.jetbrains.com/hc/en-us/community/posts/115000553690-How-to-debug-classlibrary-project-code 

so to normal c# classlibrary project, in solution, I can create classlibrary project and test in nunit project

so I have a idea to debug unity classlibrary, in solution, I can create classlibrary and create unity project in same solution to debug classlibrary code, the workflow is similar with using "nunit proejct debug normal c# classlibrary"

but I'm newer in c# and unity, and google result are all about visual studio, so can you give me a sample solution about:

one solution include:

My.Unity.ClassLibray project

My.Unity.Project.Use.My.Lib

and I can use "Attach to Unity Editor" to debug my Unity ClassLibrary code

0
3 comments

In a default case Unity3d generates a solution and all csproj files for you. So maybe create cs script in Unity, create a test script in Unity. Make Unity open Rider for you. Attach to Unity from Rider. Run tests in Unity.
I am on vacation and I can't try the whole scenario.

0
I cannot find rider way, so I have a idea:
like nodejs install all libs into node_modules
My.Unity.Lib project is Unity project and pj/lib/has my cs lib code, I can debug lib code in this unity pj
when I create new unity pj, sync all lib code to new unity pj

and I can do above with making a rider plugin to one shortcut to do
0

Please sign in to leave a comment.