Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 7.74 KB | None | 0 0
  1. public enum CurrentStates
  2.     { State_0, State_1, State_2, State_3, State_4, State_5, State_6, State_7, State_8, State_9, State_10 };
  3.     CurrentStates states; // Стейты
  4.  
  5.     private void Awake() => LoadingVideo ( );
  6.  
  7.     private void Start() => states = CurrentStates.State_0; // Включение карты заднего фона
  8.  
  9.     private void Update()
  10.     {
  11.         switch ( states )
  12.         {
  13.             #region Цикл "Заставка -> Главное меню -> Заставка
  14.             case CurrentStates.State_0:
  15.                 if ( Main_Panel.activeSelf ) Main_Panel.SetActive ( false );
  16.                 playerBackground.url = loadingClipPath [ 0 ];//Главный фон Черный
  17.                 playerBackground.isLooping = true;
  18.                 playerBackground.Play ( );
  19.                 states = CurrentStates.State_1;
  20.                 break;
  21.             case CurrentStates.State_1:
  22.                 if ( Input.anyKey && playerBackground.isPlaying )
  23.                 {
  24.                     currentTime = Time.time + waitTime;
  25.                     states = CurrentStates.State_2;
  26.                 }
  27.                 break;
  28.             case CurrentStates.State_2:
  29.                 if ( playerBackground.isPlaying &&playerBackground.url != loadingClipPath[2])
  30.                 {
  31.                     playerBackground.url = loadingClipPath [ 2 ];//Цикл фона главного меню
  32.                     playerBackground.isLooping = true;
  33.                     playerBackground.Play ( );
  34.                 }
  35.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ] ) Main_Panel.SetActive ( true );
  36.                 if ( Input.anyKey ) currentTime = Time.time + waitTime;
  37.                 if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 2 ])
  38.                 { Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
  39.                 break;
  40.             #endregion
  41.             #region Переход от галлереии
  42.             case CurrentStates.State_3:
  43.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ])
  44.                 {
  45.                     playerBackground.url = loadingClipPath [ 3 ];//Переход от главного меню на карту
  46.                     playerBackground.isLooping = false;
  47.                     playerBackground.Play ( );
  48.                 }
  49.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 3 ])
  50.                 { currentTime = Time.time + waitTime; states = CurrentStates.State_4; }
  51.                 break;
  52.             case CurrentStates.State_4:
  53.                 if ( !playerBackground.isPlaying && playerBackground.url != loadingClipPath[4])
  54.                 {
  55.                     playerBackground.url = loadingClipPath [ 4 ];//Цикл карты
  56.                     playerBackground.isLooping = true;
  57.                     playerBackground.Play ( ); Gallery_Panel.SetActive ( true );
  58.                     path.gameObject.SetActive ( true );
  59.                     path.text = $"{ currentTexture + 1} / { textureForImage.Length}";
  60.                 }
  61.                 if ( Input.anyKey ) currentTime = Time.time + waitTime;
  62.                 if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 4 ])
  63.                 { UnVizible ( ); Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
  64.                 break;
  65.             case CurrentStates.State_5:
  66.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 4 ])
  67.                 {
  68.                     playerBackground.url = loadingClipPath [ 1 ];//Переход от карты в главное меню
  69.                     playerBackground.isLooping = false;
  70.                     playerBackground.Play ( );
  71.                 }
  72.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 1 ])
  73.                 { currentTime = Time.time + waitTime; states = CurrentStates.State_6; }
  74.                 break;
  75.             case CurrentStates.State_6:
  76.                 if ( !playerBackground.isPlaying && playerBackground.url != loadingClipPath [ 2 ])
  77.                 {
  78.                     playerBackground.url = loadingClipPath [ 2 ];//Цикл фона главного меню
  79.                     playerBackground.isLooping = true;
  80.                     playerBackground.Play ( );
  81.                 }
  82.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ]) Main_Panel.SetActive ( true );
  83.                 if ( Input.anyKey ) currentTime = Time.time + waitTime;
  84.                 if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 2 ] )
  85.                 { Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
  86.                 break;
  87.             #endregion
  88.             #region Переход от документов
  89.             case CurrentStates.State_7:
  90.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ] )
  91.                 {
  92.                     playerBackground.url = loadingClipPath [ 3 ];//Переход от главного меню на карту
  93.                     playerBackground.isLooping = false;
  94.                     playerBackground.Play ( );
  95.                 }
  96.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 3 ] )
  97.                 { currentTime = Time.time + waitTime; states = CurrentStates.State_8; }
  98.                 break;
  99.             case CurrentStates.State_8:
  100.                 if ( !playerBackground.isPlaying&&playerBackground.url != loadingClipPath [ 4 ] )
  101.                 {
  102.                     Documentation_Panel.SetActive ( true );
  103.                     playerBackground.url = loadingClipPath [ 4 ];//Цикл карты
  104.                     playerBackground.isLooping = true;
  105.                     playerBackground.Play ( );
  106.                 }
  107.                 if ( Input.anyKey ) currentTime = Time.time + waitTime;
  108.                 if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 4 ] )
  109.                 { UnVizible ( ); Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
  110.                 break;
  111.             #endregion
  112.             #region Переход на карту
  113.             case CurrentStates.State_9:
  114.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 2 ] )
  115.                 {
  116.                     playerBackground.url = loadingClipPath [ 3 ];//Переход от главного меню на карту
  117.                     playerBackground.isLooping = false;
  118.                     playerBackground.Play ( );
  119.                 }
  120.                 if ( playerBackground.isPlaying && playerBackground.url == loadingClipPath [ 3 ] )
  121.                 { currentTime = Time.time + waitTime; states = CurrentStates.State_10; }
  122.                 break;
  123.             case CurrentStates.State_10:
  124.                 if ( !playerBackground.isPlaying && playerBackground.url != loadingClipPath [ 4 ] )
  125.                 {
  126.                     GeographyObj_Panel.SetActive ( true );
  127.                     geographyPlayer.Play ( );
  128.                     playerBackground.url = loadingClipPath [ 4 ]; //Цикл карты
  129.                     playerBackground.isLooping = true;
  130.                     playerBackground.Play ( );
  131.                 }
  132.                 if ( Input.anyKey ) currentTime = Time.time + waitTime;
  133.                 if ( Time.time >= currentTime && playerBackground.url == loadingClipPath [ 4 ] )
  134.                 { UnVizible ( ); Main_Panel.SetActive ( false ); states = CurrentStates.State_0; }
  135.                 break;
  136.             #endregion
  137.         }
  138.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement