public void DeleteNote(GameObject deleteButton) { int deleteInd = deleteButton.GetComponent <Test_NoteButtonController> ().buttonIndx; RecordsDataBase.RemoveAt(deleteInd); Destroy(deleteButton); }
private void OnApplicationFocus(bool focusStatus) { if (!focusStatus) { RecordsDataBase.RefreshFile(); Debug.Log("loseFocus"); } }
private void Start() { palettePanel.transform.SetParent(noteContent.transform); palettePanel.transform.SetSiblingIndex(0); palettePanel.SetActive(false); RecordsDataBase.UpdateRecordsFromFile(); List <GameObject> buttonList = new List <GameObject> (RecordsDataBase.Records.Count); GenerateRecordDisplay(); }
public void DeleteNote() { // Если параметры не переданы => удаляем "сохраненную" кнопку if (currOpenedButton == null) { return; } int deleteInd = currOpenedButton.GetComponent <Test_NoteButtonController> ().buttonIndx; RecordsDataBase.RemoveAt(deleteInd); Destroy(currOpenedButton); BackToMain(); }
public void EditNote() { if (currOpenedButton == null) { return; } int editInd = currOpenedButton.GetComponent <Test_NoteButtonController> ().buttonIndx; string editText = inputNote.text; Color inputColor = inputNote.GetComponent <Image> ().color; RecordsDataBase.EditRecord(editInd, editText, inputColor); BackToMain(); }
public void SaveNote(string newText) { newText = inputNote.text; int saveInd = (buttonList.Count + 1); string[] lines = newText.Split('\n'); string caption = lines[0].ToString(); int newLineInd = lines[0].ToString().Length; string content = newText.Substring(newLineInd); Debug.Log(caption); RecordsDataBase.AddNewRecord(ColorUtility.ToHtmlStringRGB(inputNote.GetComponent <Image> ().color), caption, content); BackToMain(); }
private void OnApplicationQuit() { RecordsDataBase.RefreshFile(); Debug.Log("Quit"); }