File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -47,21 +47,26 @@ private void Start()
4747
4848 private void Update ( )
4949 {
50- if ( Input . GetButtonDown ( "Oculus_CrossPlatform_Button_1" ) )
50+ if ( PlayerPrefs . GetFloat ( "subtitles" ) == 0 &&
51+ ( Input . GetKeyDown ( KeyCode . Space ) || Input . GetButtonDown ( "Oculus_CrossPlatform_Button_1" ) ) )
5152 {
5253 PlayerPrefs . SetFloat ( "subtitles" , 1 ) ;
5354
5455 SceneManager . LoadScene ( "A11YTk" ) ;
5556 }
5657
57- if ( _currentVolume > 0 )
58+ foreach ( var videoPlayer in _videoPlayers )
5859 {
59- _currentVolume = Mathf . Lerp ( _currentVolume , 0 , Time . deltaTime ) ;
60+ videoPlayer . SetDirectAudioVolume ( 0 , _currentVolume ) ;
6061 }
6162
62- foreach ( var videoPlayer in _videoPlayers )
63+ if ( Input . GetKey ( KeyCode . Space ) || Input . GetButton ( "Oculus_CrossPlatform_Button_1" ) )
6364 {
64- videoPlayer . SetDirectAudioVolume ( 0 , _currentVolume ) ;
65+ _currentVolume = Mathf . Lerp ( _currentVolume , 1 , Time . deltaTime ) ;
66+ }
67+ else
68+ {
69+ _currentVolume = Mathf . Lerp ( _currentVolume , 0 , Time . deltaTime ) ;
6570 }
6671 }
6772}
You can’t perform that action at this time.
0 commit comments