private void OnSoundCreated(Sound sound) { SoundLabel soundLabel = Instantiate(_labelPrefab, transform); soundLabel.SetText(sound.playableSound.pitch.ToString()); _labels[sound.playableSound.id] = soundLabel; soundLabel.gameObject.SetActive(false); }
private void OnSoundUpdated(Sound sound) { Vector3 screenPoint = _camera.WorldToScreenPoint(sound.transform.position); SoundLabel soundLabel = _labels[sound.playableSound.id]; soundLabel.transform.position = screenPoint; if (!soundLabel.gameObject.activeSelf) { soundLabel.gameObject.SetActive(true); } }