robertohuertasm / SQLite4Unity3d

SQLite made easy for Unity3d
MIT License
1.27k stars 265 forks source link

How to define Class Tables in an external dll? #95

Closed daybson closed 4 years ago

daybson commented 5 years ago

I need to create my class in an external project, then import it in unity as a dll. Like-> RPGSystem.dll (.net standard 2.0 dll)

Then I would like to use some of his classes like Character as a table in sqlite4unity.

If I import sqlite-net-pcl in my dll project, I can tag the classes like

class Character { [PrimaryKey] public int Id {get;set;} }

But Unity is not recognizing it to create the data table in SQLite... The error message I got from Unity when I try to run, using the schema I said above:

"FileNotFoundException: Could not load file or assembly 'SQLite-net, Version=1.5.231.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies."