void OnDeleteButtonPressed(int id) { int d = -1; foreach (NoteData note in notedata) { d++; if (id == note.ID) { currentDelID = id; ConfirmationDeletePannel.SetActive(true); } } }
public void NoteBookContent() { saveload.Load(); FileNameTitle.text = saveload.current_filenameCallingName; GameObject[] goo = GameObject.FindGameObjectsWithTag("Note"); ConfirmationDeletePannel.SetActive(false); foreach (GameObject g in goo) { Destroy(g); } LoadNotes(); if (notedata.Count > 0) { StatusTextNotebook.text = " "; foreach (NoteData note in notedata) { GameObject go = Instantiate(NotePrefab); go.transform.SetParent(NoteContentArea); go.transform.localScale = Vector3.one; go.transform.Find("DeleteButton").name = "Del:" + note.TextData; go.transform.Find("EditButton").name = "Edit:" + note.TextData; go.GetComponent <Text>().text = note.TextData; int noumberOfLines = Mathf.RoundToInt(note.TextData.Length / 40); print(note.TextData); //print(noumberOfLines); int i = 13; char c = Convert.ToChar(i); string[] item = note.TextData.Split(c); print("Enter Button " + item.Length); if (note.TextData.Contains(c.ToString())) { print("e"); } else { print("f"); } if (noumberOfLines > 1) { go.GetComponent <RectTransform>().sizeDelta = new Vector2(1080, (51 * noumberOfLines)); } } } else { StatusTextNotebook.text = "No Note Found"; StatusTextNotebook.color = Color.blue; } }