I am working on an RPG in Unity3d. I have successfully refactored the code to run an SQL database and into a singleton pattern. The gameobject
is created at runtime.
In each table I create a list based on its property script; I'm creating it there because it accesses the database. The other script is attached to the top panel where I want to display the character's name and stats, but I'm having trouble getting access to the list.
PlayerDatabaseManager PDM;
void Awake()
{
PlayerDatabaseManager.Instance.LoadPersonal();
}
// Use this for initialization
void Start ()
{
PDM.GetComponent<PlayerDatabaseManager>.Personal();
Personal = PDM.Personal.Name();
}
I'm confused what to put where. Does personal need to be of type databasemanager
or of type personal
?