public void Connect(string host, string username, string password, string database) { string connectionString = "Host=" + host + ";" + "Username="******";" + "Password="******";" + "Database=" + database; try { dbconn = new NpgsqlConnection(connectionString); dbconn.Open(); if (cameraAnimator != null) { cameraAnimator.enabled = true; } } catch (Exception ex) { Debug.Log(ex.Message); ModalWindowMaker.Instance().DBConnectionError(host, username, password, database); } }
public static ModalWindowMaker Instance() { if (!modalWindowMaker) { modalWindowMaker = FindObjectOfType(typeof(ModalWindowMaker)) as ModalWindowMaker; if (!modalWindowMaker) { Debug.LogError("There needs to be one active ModalWindowMaker script on a GameObject in your scene."); } } return(modalWindowMaker); }