void MakeDialog() { int dialog_id = getIntPrefsSafe("DialogToLoad", "DialogSystem. MakeDialog()"); if (dialog_id > 0) { currentDialog = db.GetDialogById(dialog_id); Debug.Log(currentDialog.ToString()); trySetPicture(); DMainText.text = currentDialog.text; for (int i = 0; i < BtnTexts.Length; ++i) { BtnTexts[i].text = currentDialog.getBtnText(i + 1); } } else if (dialog_id == 0) { finish(); } else { Debug.Log("Dialog can NOT be loaded."); finish(); } }
/*public void CreateDB(){ * _connection.DropTable<Person> (); * _connection.CreateTable<Person> (); * * _connection.InsertAll (new[]{ * new Person{ * Id = 1, * Name = "Tom", * Surname = "Perez", * Age = 56 * }, * new Person{ * Id = 2, * Name = "Fred", * Surname = "Arthurson", * Age = 16 * }, * new Person{ * Id = 3, * Name = "John", * Surname = "Doe", * Age = 25 * }, * new Person{ * Id = 4, * Name = "Roberto", * Surname = "Huertas", * Age = 37 * } * }); * } */ public Dialog2 GetDialogById(int d_id) { //Получить диалог по ID Dialog2 res = new Dialog2(); foreach (var tmp in _connection.Table <Dialog2>().Where(x => x.id == d_id)) { res = tmp; } return(res); }
//연습모드 변수 //PracticeManager m_practiceManager; private void Awake() { m_gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); m_script = GameObject.Find("DialogGenerator").GetComponent <Dialog2>(); m_audio = GetComponent <AudioSource>(); }