c# - Use non monoBehaviour class in unity -


i'm going through bug or @ least don't get.

i'm trying use sqlite database in unity project.

here error get:

enter image description here

the databasemanager class monobehaviour class.

here looks like:

using unityengine; using system.collections;  public class databasemanager : monobehaviour { sqlitedatabase sqldb;  void awake()  {     string dbpath = system.io.path.combine (application.persistentdatapath, "game.db");     var dbtemplatepath = system.io.path.combine(application.streamingassetspath, "default.db");      if (!system.io.file.exists(dbpath)) {         // game database not exists, copy default db template         if (application.platform == runtimeplatform.android)         {             // must use www streaming asset             www reader = new www(dbtemplatepath);             while ( !reader.isdone) {}             system.io.file.writeallbytes(dbpath, reader.bytes);         } else {             system.io.file.copy(dbtemplatepath, dbpath, true);         }            }     sqldb = new sqlitedatabase(dbpath); } } 

the thing if got right, fact put scripts under assets folder should enough them work , recognize classes in other files. problem simple databasemanager class not recognize sqlitedatabase class implemented in sqlitedatabase.cs

have had issue or did miss on how reference non monobehaviour script in monobehaviour 1 ?

edit:

i used tutorial : here

thanks !

you seem having minor capitalization typo in code.

replace sqlitedatabase sqldb sqlitedatabase sqldb.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -