Ejemplo n.º 1
0
    public void DeleteNote(GameObject deleteButton)
    {
        int deleteInd = deleteButton.GetComponent <Test_NoteButtonController> ().buttonIndx;

        RecordsDataBase.RemoveAt(deleteInd);
        Destroy(deleteButton);
    }
Ejemplo n.º 2
0
 private void OnApplicationFocus(bool focusStatus)
 {
     if (!focusStatus)
     {
         RecordsDataBase.RefreshFile();
         Debug.Log("loseFocus");
     }
 }
Ejemplo n.º 3
0
    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();
    }
Ejemplo n.º 4
0
    public void DeleteNote()
    {
        // Если параметры не переданы => удаляем "сохраненную" кнопку
        if (currOpenedButton == null)
        {
            return;
        }
        int deleteInd = currOpenedButton.GetComponent <Test_NoteButtonController> ().buttonIndx;

        RecordsDataBase.RemoveAt(deleteInd);
        Destroy(currOpenedButton);
        BackToMain();
    }
Ejemplo n.º 5
0
    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();
    }
Ejemplo n.º 6
0
    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();
    }
Ejemplo n.º 7
0
 private void OnApplicationQuit()
 {
     RecordsDataBase.RefreshFile();
     Debug.Log("Quit");
 }