private GameObject PlaceFeedback(string noteText, string authorText, Vector3 position, Quaternion rotation, bool sendToFirebase = true) { // create note object GameObject newNote = Instantiate(notePrefab, position, rotation) as GameObject; newNote.transform.parent = anchorObject.transform; newNote.name = "note"; // set text of note TMP_Text[] newNoteText = newNote.GetComponentsInChildren <TMP_Text>(); newNoteText[0].text = noteText; newNoteText[1].text = "- " + authorText; // send note data to firebase if (sendToFirebase) { FeedbackData fd = new FeedbackData( noteText, authorText, newNote.transform.position - anchorObject.transform.position, newNote.transform.rotation * Quaternion.Inverse(anchorObject.transform.rotation)); firebaseHandler.AddFeedback(anchorObject.name, fd); } return(newNote); }