public List <GeneralValues> GetGeneralValues(short?id = null, string code = null) { try { List <GeneralValues> returnList = new List <GeneralValues>(); if (System.Web.HttpContext.Current != null) { Rp3.Security.Cryptography.KeyFileName = System.Web.HttpContext.Current.Server.MapPath("~/key"); } else { Rp3.Security.Cryptography.KeyFileName = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(General)).Location), "Key"); } ContextService db = new ContextService(); var list = db.GeneralValues.Get(p => (id == null || p.Id == id) && (code == null || p.Code == code)); foreach (var item in list) { GeneralValues det = new GeneralValues(); Rp3.Data.Service.CopyTo(item, det, includeProperties: new string[] { "Id", "Code", "Content", "Reference01", "Reference02" }); returnList.Add(det); } return(returnList); } catch (Exception e) { return(null); } }
// Start is called before the first frame update void Start() { generalValues = GameObject.Find("GeneralValues").GetComponent <GeneralValues>(); levelUpText.enabled = false; nextLevelUp = 100; score = 0; level = 1; Time.timeScale = 1.0f; gameoverPanel.SetActive(false); background = GameObject.Find("Main Camera").GetComponent <AudioSource>(); musicOn.SetActive(false); play.SetActive(false); pausePanel.SetActive(false); fallCycle = 1.0f; addBlocsCycle = 2000; if (generalValues.difficulty == 1) { addBlocsCycle = 30; } else if (generalValues.difficulty == 2) { addBlocsCycle = 24; } }