예제 #1
0
 public void SelectRight()
 {
     GetComponent <AudioSource>().PlayOneShot(audio_Clip[1]);
     if (Map2.transform.position == posMap2)
     {
         iTween.MoveTo(Map2, posMap1, 0.5f);
         Map2.GetComponent <SpriteRenderer>().enabled = false;
         img2.GetComponent <SpriteRenderer>().enabled = false;
         Map3.GetComponent <SpriteRenderer>().enabled = true;
         img3.GetComponent <SpriteRenderer>().enabled = true;
         if (player.levelGame != 6)
         {
             img3.GetComponent <SpriteRenderer>().sprite = imgSprite[player.levelGame];
         }
         else
         {
             img3.GetComponent <SpriteRenderer>().sprite = imgSprite[0];
         }
         iTween.MoveTo(Map3, posMap2, 0.5f);
         Map1.transform.position = posMap3;
         player.levelGame++;
         if (player.levelGame > 6)
         {
             player.levelGame = 1;
         }
         if (player.levelGame != 6)
         {
             Map1.GetComponent <SpriteRenderer>().sprite = mapSprite[player.levelGame];
         }
         else
         {
             Map1.GetComponent <SpriteRenderer>().sprite = mapSprite[0];
         }
         //levelNameText.text = "" + player.levelGame;
     }
     else if (Map1.transform.position == posMap2)
     {
         iTween.MoveTo(Map1, posMap1, 0.5f);
         Map1.GetComponent <SpriteRenderer>().enabled = false;
         img1.GetComponent <SpriteRenderer>().enabled = false;
         Map2.GetComponent <SpriteRenderer>().enabled = true;
         img2.GetComponent <SpriteRenderer>().enabled = true;
         if (player.levelGame != 6)
         {
             img2.GetComponent <SpriteRenderer>().sprite = imgSprite[player.levelGame];
         }
         else
         {
             img2.GetComponent <SpriteRenderer>().sprite = imgSprite[0];
         }
         iTween.MoveTo(Map2, posMap2, 0.5f);
         Map3.transform.position = posMap3;
         player.levelGame++;
         if (player.levelGame > 6)
         {
             player.levelGame = 1;
         }
         if (player.levelGame != 6)
         {
             Map3.GetComponent <SpriteRenderer>().sprite = mapSprite[player.levelGame];
         }
         else
         {
             Map3.GetComponent <SpriteRenderer>().sprite = mapSprite[0];
         }
         //levelNameText.text = "" + player.levelGame;
     }
     else if (Map3.transform.position == posMap2)
     {
         iTween.MoveTo(Map3, posMap1, 0.5f);
         Map3.GetComponent <SpriteRenderer>().enabled = false;
         img3.GetComponent <SpriteRenderer>().enabled = false;
         Map1.GetComponent <SpriteRenderer>().enabled = true;
         img1.GetComponent <SpriteRenderer>().enabled = true;
         if (player.levelGame != 6)
         {
             img1.GetComponent <SpriteRenderer>().sprite = imgSprite[player.levelGame];
         }
         else
         {
             img1.GetComponent <SpriteRenderer>().sprite = imgSprite[0];
         }
         iTween.MoveTo(Map1, posMap2, 0.5f);
         Map2.transform.position = posMap3;
         player.levelGame++;
         if (player.levelGame > 6)
         {
             player.levelGame = 1;
         }
         if (player.levelGame != 6)
         {
             Map2.GetComponent <SpriteRenderer>().sprite = mapSprite[player.levelGame];
         }
         else
         {
             Map2.GetComponent <SpriteRenderer>().sprite = mapSprite[0];
         }
         //levelNameText.text = "" + player.levelGame;
     }
 }