SHARE
TWEET

Untitled

a guest Jun 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void LeftPartFalls()
  2. {
  3.     if (LeftPartMat)
  4.     {
  5.         for (int i = 0; i < Mathf.Min(5, FirstLine.Length); i++)        // COLOR CHANGE
  6.         {
  7.             FirstLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  8.             SecondLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  9.             ThirdLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  10.             FourthLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  11.             FiftLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  12.             SixthLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  13.             SeventhLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  14.             EighthLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  15.             NinthLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  16.             TenthLine[i].gameObject.GetComponent<MeshRenderer>().material = greyMAT;
  17.         }
  18.     }
  19.     if (!LeftPartMat)
  20.     {
  21.         for (int i = 0; i < Mathf.Min(5, FirstLine.Length); i++)        // COLOR CHANGE 2
  22.         {
  23.             FirstLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  24.             SecondLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  25.             ThirdLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  26.             FourthLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  27.             FiftLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  28.             SixthLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  29.             SeventhLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  30.             EighthLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  31.             NinthLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  32.             TenthLine[i].gameObject.GetComponent<MeshRenderer>().material = whiteMAT;
  33.         }
  34.     }
  35.  
  36.     if (LeftPartFall)       // FALL DOWN
  37.     {
  38.         for (int i = 0; i < Mathf.Min(5, FirstLine.Length); i++)
  39.         {
  40.             FirstLine[i].gameObject.transform.position = Vector3.Lerp(FirstLine[i].transform.position, new Vector3(FirstLine[i].transform.position.x, -4f, FirstLine[i].transform.position.z), t);
  41.             SecondLine[i].gameObject.transform.position = Vector3.Lerp(SecondLine[i].transform.position, new Vector3(SecondLine[i].transform.position.x, -4f, SecondLine[i].transform.position.z), t);
  42.             ThirdLine[i].gameObject.transform.position = Vector3.Lerp(ThirdLine[i].transform.position, new Vector3(ThirdLine[i].transform.position.x, -4f, ThirdLine[i].transform.position.z), t);
  43.             FourthLine[i].gameObject.transform.position = Vector3.Lerp(FourthLine[i].transform.position, new Vector3(FourthLine[i].transform.position.x, -4f, FourthLine[i].transform.position.z), t);
  44.             FiftLine[i].gameObject.transform.position = Vector3.Lerp(FiftLine[i].transform.position, new Vector3(FiftLine[i].transform.position.x, -4f, FiftLine[i].transform.position.z), t);
  45.             SixthLine[i].gameObject.transform.position = Vector3.Lerp(SixthLine[i].transform.position, new Vector3(SixthLine[i].transform.position.x, -4f, SixthLine[i].transform.position.z), t);
  46.             SeventhLine[i].gameObject.transform.position = Vector3.Lerp(SeventhLine[i].transform.position, new Vector3(SeventhLine[i].transform.position.x, -4f, SeventhLine[i].transform.position.z), t);
  47.             EighthLine[i].gameObject.transform.position = Vector3.Lerp(EighthLine[i].transform.position, new Vector3(EighthLine[i].transform.position.x, -4f, EighthLine[i].transform.position.z), t);
  48.             NinthLine[i].gameObject.transform.position = Vector3.Lerp(NinthLine[i].transform.position, new Vector3(NinthLine[i].transform.position.x, -4f, NinthLine[i].transform.position.z), t);
  49.             TenthLine[i].gameObject.transform.position = Vector3.Lerp(TenthLine[i].transform.position, new Vector3(TenthLine[i].transform.position.x, -4f, TenthLine[i].transform.position.z), t);
  50.         }
  51.     }
  52.     if (!LeftPartFall)      // RISE UP
  53.     {
  54.         for (int i = 0; i < Mathf.Min(5, FirstLine.Length); i++)
  55.         {
  56.             FirstLine[i].gameObject.transform.position = Vector3.Lerp(FirstLine[i].transform.position, new Vector3(FirstLine[i].transform.position.x, 0f, FirstLine[i].transform.position.z), t);
  57.             SecondLine[i].gameObject.transform.position = Vector3.Lerp(SecondLine[i].transform.position, new Vector3(SecondLine[i].transform.position.x, 0f, SecondLine[i].transform.position.z), t);
  58.             ThirdLine[i].gameObject.transform.position = Vector3.Lerp(ThirdLine[i].transform.position, new Vector3(ThirdLine[i].transform.position.x, 0f, ThirdLine[i].transform.position.z), t);
  59.             FourthLine[i].gameObject.transform.position = Vector3.Lerp(FourthLine[i].transform.position, new Vector3(FourthLine[i].transform.position.x, 0f, FourthLine[i].transform.position.z), t);
  60.             FiftLine[i].gameObject.transform.position = Vector3.Lerp(FiftLine[i].transform.position, new Vector3(FiftLine[i].transform.position.x, 0f, FiftLine[i].transform.position.z), t);
  61.             SixthLine[i].gameObject.transform.position = Vector3.Lerp(SixthLine[i].transform.position, new Vector3(SixthLine[i].transform.position.x, 0f, SixthLine[i].transform.position.z), t);
  62.             SeventhLine[i].gameObject.transform.position = Vector3.Lerp(SeventhLine[i].transform.position, new Vector3(SeventhLine[i].transform.position.x, 0f, SeventhLine[i].transform.position.z), t);
  63.             EighthLine[i].gameObject.transform.position = Vector3.Lerp(EighthLine[i].transform.position, new Vector3(EighthLine[i].transform.position.x, 0f, EighthLine[i].transform.position.z), t);
  64.             NinthLine[i].gameObject.transform.position = Vector3.Lerp(NinthLine[i].transform.position, new Vector3(NinthLine[i].transform.position.x, 0f, NinthLine[i].transform.position.z), t);
  65.             TenthLine[i].gameObject.transform.position = Vector3.Lerp(TenthLine[i].transform.position, new Vector3(TenthLine[i].transform.position.x, 0f, TenthLine[i].transform.position.z), t);
  66.         }
  67.     }
  68. }
  69.      
  70. private IEnumerator enumerator(float waitTime)
  71. {
  72.     while (true)
  73.     {
  74.         RandomInt = Random.Range(1, 6);
  75.         if (RandomInt == 1)
  76.         {
  77.             LeftPartCalls = true;
  78.             LeftPartMat = true;
  79.         }
  80.         if (RandomInt == 2)
  81.         {
  82.             RightPartCalls = true;
  83.             RightPartMat = true;
  84.         }
  85.         if (RandomInt == 3)
  86.         {
  87.             VerticalStripeCalls = true;
  88.             VerticalStripeMat = true;
  89.         }
  90.         if (RandomInt == 4)
  91.         {
  92.             UpLeftDownRightCalls = true;
  93.             UpLeftDownRightMat = true;
  94.         }
  95.         if (RandomInt == 5)
  96.         {
  97.             UpRightDownLeftCalls = true;
  98.             UpRightDownLeftMat = true;
  99.         }
  100.         if (RandomInt == 6)
  101.         {
  102.             HorizontalStripeCalls = true;
  103.             HorizontalStripeMat = true;
  104.         }
  105.         if (RandomInt == 7)
  106.         {
  107.             CenterCalls = true;
  108.             CenterMat = true;
  109.         }
  110.         if (RandomInt == 8)
  111.         {
  112.             EdgeCalls = true;
  113.             EdgeMat = true;
  114.         }
  115.         if (RandomInt == 9)
  116.         {
  117.             SkewCalls = true;
  118.             SkewMat = true;
  119.         }
  120.         if (RandomInt == 10)
  121.         {
  122.             HorizontalWayCalls = true;
  123.             HorizontalWayMat = true;
  124.         }
  125.  
  126.  
  127.         yield return new WaitForSeconds(MoveT);
  128.         if (RandomInt == 1)
  129.             LeftPartFall = true;
  130.         if (RandomInt == 2)
  131.             RightPartFall = true;
  132.         if (RandomInt == 3)
  133.             VerticalStripeFall = true;
  134.         if (RandomInt == 4)
  135.             UpLeftDownRightFall = true;
  136.         if (RandomInt == 5)
  137.             UpRightDownLeftFall = true;
  138.         if (RandomInt == 6)
  139.             HorizontalStripeFall = true;
  140.         if (RandomInt == 7)
  141.             CenterFall = true;
  142.         if (RandomInt == 8)
  143.             EdgeFall = true;
  144.         if (RandomInt == 9)
  145.             SkewFall = true;
  146.         if (RandomInt == 10)
  147.             HorizontalWayFall= true;
  148.  
  149.         t = 0f;
  150.         t += Time.deltaTime / 0.7f;
  151.  
  152.         yield return new WaitForSeconds(3);
  153.         LeftPartFall = false;
  154.         LeftPartMat = false;
  155.         RightPartMat = false;
  156.         RightPartFall = false;
  157.         VerticalStripeMat = false;                                  
  158.         VerticalStripeFall = false;
  159.         UpLeftDownRightFall = false;
  160.         UpLeftDownRightMat = false;
  161.         UpRightDownLeftFall = false;
  162.         UpRightDownLeftMat = false;
  163.         HorizontalStripeFall = false;
  164.         HorizontalStripeMat = false;
  165.         CenterFall = false;
  166.         CenterMat = false;
  167.         EdgeFall = false;
  168.         EdgeMat = false;
  169.         SkewFall = false;
  170.         SkewMat = false;
  171.         HorizontalWayFall = false;
  172.         HorizontalWayMat = false;
  173.         yield return new WaitForSeconds(4);
  174.         LeftPartCalls = false;
  175.         RightPartCalls = false;
  176.         VerticalStripeCalls = false;
  177.         UpLeftDownRightCalls = false;
  178.         UpRightDownLeftCalls = false;
  179.         HorizontalStripeCalls = false;
  180.         CenterCalls = false;
  181.         EdgeCalls = false;
  182.         SkewCalls = false;
  183.         HorizontalWayCalls = false;
  184.  
  185.         if (MoveT >= 1.3f)
  186.         {
  187.             MoveT -= 0.7f;
  188.         }
  189.         if (MoveT <= 1.3f)
  190.         {
  191.             MoveT -= 0.6f;
  192.         }
  193.         if (MoveT <= 0.7f)
  194.         {
  195.             MoveT = 0.7f;
  196.         }
  197.         yield return new WaitForSeconds(MoveT);
  198.     }
  199. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top