private static void FindOrInitializeDBModule() { //Debug.Log("DBModule not set. Searching..."); if(moduleGO == null ) moduleGO = new GameObject(); GameObject go = GameObject.FindGameObjectWithTag("DBModule"); if (go == null) { Log.Debug("DBModule not found. Creating..."); moduleGO.AddComponent<DBModule>(); moduleGO.name = "DBModule"; moduleGO.tag = "DBModule"; module = moduleGO.GetComponent<DBModule>(); Log.Debug("DBModule created and set. Returning..."); } else { moduleGO = go; module = moduleGO.GetComponent<DBModule>(); Log.Debug("DBModule found. Returning..."); } }
public void Clear() { Debug.Log("Clear DBModuleManager"); module = null; moduleGO = null; eventList.Clear(); }