if (FileManager.Instance.isAudio) { AudioSource p = FileManager.Instance.audioSource;…
- User
if (FileManager.Instance.isAudio) { AudioSource p = FileManager.Instance.audioSource; p.time = 0; } else { VideoPlayer p = FileManager.Instance.videoPlayer; p.frame = -1; }
- Assistant
If the
FileManagerinstance hasisAudioset to true, then it means it is dealing with an audio file. In this case, we can access theaudioSourceproperty from theFileManagerinstance and assign it to a variablepof typeAudioSource. We can then set thetimeproperty ofpto 0, which will reset the audio playback to the beginning.If
isAudiois false, then it means it is dealing with a video file. In this case, we can access thevideoPlayerproperty from theFileManagerinstance and assign it to a variablepof typeVideoPlayer. We can then set theframeproperty ofpto -1, which will reset the video playback to the beginning.