UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"play the audio on zoom out"
public class ZoomOutAudio : MonoBehaviour { [SerializeField] ZoomByControl zoomChangeEvent = null; void Start() { zoomChangeEvent.OnZoomChange = ZoomByControl_OnZoomChange; } private void ZoomByControl_OnZoomChange(object sender, ZoomByControl.OnZoomChangeEventArgs e) { if (e.In) { this.GetComponent<AudioSource>().Play(); } else { } } }