Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum CurrentStates
- { State_0, State_1, State_2, State_3, State_4, State_5, State_6, State_7, State_8, State_9, State_10 };
- CurrentStates states; // Стейты
- private void Awake() => LoadingVideo ( );
- private void Start() => states = CurrentStates.State_0; // Включение карты заднего фона
- private void Update()
- {
- switch ( states )
- {
- #region Цикл "Заставка -> Главное меню -> Заставка
- case CurrentStates.State_0:
- if ( Main_Panel.activeSelf ) Main_Panel.SetActive ( false );
- playerBackground.url = loadingClipPath [ 0 ];//Главный фон Черный
- playerBackground.isLooping = true;
- playerBackground.Play ( );
- states = CurrentStates.State_1;
- break;
- case CurrentStates.State_1:
- if ( Input.anyKey && playerBackground.isPlaying )
- {
- currentTime = Time.time + waitTime;
- states = CurrentStates.State_2;
- }
- break;
- case CurrentStates.State_2:
- if ( playerBackground.isPlaying &&playerBackground.url != loadingClipPath[2])
- {
- playerBackground.url = loadingClipPath [ 2 ];//Цикл фона главного меню
- playerBackground.isLooping = true;
- playerBackground.Play ( );
- }
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ] ) Main_Panel.SetActive ( true );
- if ( Input.anyKey ) currentTime = Time.time + waitTime;
- if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 2 ])
- { Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
- break;
- #endregion
- #region Переход от галлереии
- case CurrentStates.State_3:
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ])
- {
- playerBackground.url = loadingClipPath [ 3 ];//Переход от главного меню на карту
- playerBackground.isLooping = false;
- playerBackground.Play ( );
- }
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 3 ])
- { currentTime = Time.time + waitTime; states = CurrentStates.State_4; }
- break;
- case CurrentStates.State_4:
- if ( !playerBackground.isPlaying && playerBackground.url != loadingClipPath[4])
- {
- playerBackground.url = loadingClipPath [ 4 ];//Цикл карты
- playerBackground.isLooping = true;
- playerBackground.Play ( ); Gallery_Panel.SetActive ( true );
- path.gameObject.SetActive ( true );
- path.text = $"{ currentTexture + 1} / { textureForImage.Length}";
- }
- if ( Input.anyKey ) currentTime = Time.time + waitTime;
- if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 4 ])
- { UnVizible ( ); Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
- break;
- case CurrentStates.State_5:
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 4 ])
- {
- playerBackground.url = loadingClipPath [ 1 ];//Переход от карты в главное меню
- playerBackground.isLooping = false;
- playerBackground.Play ( );
- }
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 1 ])
- { currentTime = Time.time + waitTime; states = CurrentStates.State_6; }
- break;
- case CurrentStates.State_6:
- if ( !playerBackground.isPlaying && playerBackground.url != loadingClipPath [ 2 ])
- {
- playerBackground.url = loadingClipPath [ 2 ];//Цикл фона главного меню
- playerBackground.isLooping = true;
- playerBackground.Play ( );
- }
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ]) Main_Panel.SetActive ( true );
- if ( Input.anyKey ) currentTime = Time.time + waitTime;
- if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 2 ] )
- { Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
- break;
- #endregion
- #region Переход от документов
- case CurrentStates.State_7:
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ] )
- {
- playerBackground.url = loadingClipPath [ 3 ];//Переход от главного меню на карту
- playerBackground.isLooping = false;
- playerBackground.Play ( );
- }
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 3 ] )
- { currentTime = Time.time + waitTime; states = CurrentStates.State_8; }
- break;
- case CurrentStates.State_8:
- if ( !playerBackground.isPlaying&&playerBackground.url != loadingClipPath [ 4 ] )
- {
- Documentation_Panel.SetActive ( true );
- playerBackground.url = loadingClipPath [ 4 ];//Цикл карты
- playerBackground.isLooping = true;
- playerBackground.Play ( );
- }
- if ( Input.anyKey ) currentTime = Time.time + waitTime;
- if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 4 ] )
- { UnVizible ( ); Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
- break;
- #endregion
- #region Переход на карту
- case CurrentStates.State_9:
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ] )
- {
- playerBackground.url = loadingClipPath [ 3 ];//Переход от главного меню на карту
- playerBackground.isLooping = false;
- playerBackground.Play ( );
- }
- if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 3 ] )
- { currentTime = Time.time + waitTime; states = CurrentStates.State_10; }
- break;
- case CurrentStates.State_10:
- if ( !playerBackground.isPlaying && playerBackground.url != loadingClipPath [ 4 ] )
- {
- GeographyObj_Panel.SetActive ( true );
- geographyPlayer.Play ( );
- playerBackground.url = loadingClipPath [ 4 ]; //Цикл карты
- playerBackground.isLooping = true;
- playerBackground.Play ( );
- }
- if ( Input.anyKey ) currentTime = Time.time + waitTime;
- if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 4 ] )
- { UnVizible ( ); Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
- break;
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement