public void DeleteTextToSpeechAnnotation(TextToSpeechAnnotation ttsAnnotation) { if (ttsAnnotation == null) { Debug.Log("ERROR: TextToSpeechAnnotation object is null"); return; } foreach (TextToSpeechAnnotation annotation in TextToSpeechAnnotationList) { if (annotation.Text.Equals(ttsAnnotation.Text) && annotation.isTheSamePosition(ttsAnnotation.Position)) { if (TextToSpeechAnnotationList.Remove(ttsAnnotation)) { Debug.Log("TextToSpeechAnnotation - " + ttsAnnotation.Text + " was delete from list"); } else { Debug.Log("ERROR: Unable to delete TextToSpeechAnnotation - " + ttsAnnotation.Text); } return; } } Debug.Log("ERROR: Unable to find the TextToSpeechAnnotation - " + ttsAnnotation.Text); }
public void AddTextToSpeechAnnotation(string text, Vector3 pos, float timeOfCreation) { TextToSpeechAnnotation ttsAnnotation = new TextToSpeechAnnotation(); ttsAnnotation.Text = text; ttsAnnotation.Position = pos; ttsAnnotation.TimeOfCreation = timeOfCreation; TextToSpeechAnnotationList.Add(ttsAnnotation); }