Beispiel #1
0
    public void ShowAvatarList(bool b)
    {
        bool c = false;

        for (int i = 2; i < Player.item.Count; i++)
        {
            if (Player.item[i] == 1)
            {
                c = true;
                break;
            }
        }
        if (b && c)
        {
            avatarpanel.SetActive(true);

            for (int i = 2; i < Player.item.Count; i++)
            {
                if (Player.item[i] != 0)
                {
                    GameObject g = Instantiate(AvatarPrefab, scrollavatar);
                    g.GetComponent <Image>().sprite = scrollshop.GetChild(i).GetChild(0).GetComponent <Image>().sprite;
                    g.GetComponent <Button>().AddEvent(i, loadImage);
                }
            }
            if (AcountManager.instance.isFb)
            {
                GameObject fb = Instantiate(AvatarPrefab, scrollavatar);
                fb.GetComponent <Image>().sprite = AcountManager.instance.FbSprite;
                fb.GetComponent <Button>().AddEvent(0, loadFb);
                BtnAvatar.SetActive(false);
            }
        }
    }
Beispiel #2
0
 public void ShowAcountPanel(bool e)
 {
     if (e)
     {
         AcountPanel.SetActive(true);
         AccountButton.SetActive(false);
         InfoButton.SetActive(false);
         SettingsButton.SetActive(false);
         LeaderButton.SetActive(false);
         PlayScreen.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         Camera.GetComponent <CameraController>().enabled = false;
     }
     else
     {
         AcountPanel.SetActive(false);
         AccountButton.SetActive(true);
         InfoButton.SetActive(true);
         SettingsButton.SetActive(true);
         LeaderButton.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         PlayScreen.SetActive(true);
         Camera.GetComponent <CameraController>().enabled = true;
     }
 }
Beispiel #3
0
 public void ShowConfirm(bool y)
 {
     if (y)
     {
         ConfirmPanel.SetActive(true);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         InfoButton.GetComponent <Button>().interactable           = false;
         SettingsButton.GetComponent <Button>().interactable       = false;
         AccountBtnIcon.GetComponent <Button>().interactable       = false;
         LeaderButton.GetComponent <Button>().interactable         = false;
         PlayScreen.GetComponentInChildren <Button>().interactable = false;
         Camera.GetComponent <CameraController>().enabled          = false;
     }
     else
     {
         ConfirmPanel.SetActive(false);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         InfoButton.GetComponent <Button>().interactable           = true;
         SettingsButton.GetComponent <Button>().interactable       = true;
         PlayScreen.GetComponentInChildren <Button>().interactable = true;
         AccountBtnIcon.GetComponent <Button>().interactable       = true;
         LeaderButton.GetComponent <Button>().interactable         = true;
         Camera.GetComponent <CameraController>().enabled          = true;
     }
 }
Beispiel #4
0
 public void ShowLeaderBoardPanel(bool r)
 {
     if (r)
     {
         leaderboardWindow.SetActive(true);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         InfoButton.GetComponent <Button>().interactable           = false;
         SettingsButton.GetComponent <Button>().interactable       = false;
         AccountBtnIcon.GetComponent <Button>().interactable       = false;
         LeaderButton.GetComponent <Button>().interactable         = false;
         PlayScreen.GetComponentInChildren <Button>().interactable = false;
         Camera.GetComponent <CameraController>().enabled          = false;
     }
     else
     {
         leaderboardWindow.SetActive(false);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         InfoButton.GetComponent <Button>().interactable           = true;
         SettingsButton.GetComponent <Button>().interactable       = true;
         PlayScreen.GetComponentInChildren <Button>().interactable = true;
         AccountBtnIcon.GetComponent <Button>().interactable       = true;
         LeaderButton.GetComponent <Button>().interactable         = true;
         Camera.GetComponent <CameraController>().enabled          = true;
     }
 }
Beispiel #5
0
 public void ShowModesPage(bool y)
 {
     if (y)
     {
         PlayScreen.SetActive(false);
         InfoButton.SetActive(false);
         TextMeshHome.SetActive(false);
         LeaderButton.SetActive(false);
         SettingsButton.SetActive(false);
         AccountBtnIcon.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         BackToHomeButton.SetActive(true);
         ModesPage.SetActive(true);
     }
     else
     {
         BackToHomeButton.SetActive(false);
         ModesPage.SetActive(false);
         PlayScreen.SetActive(true);
         InfoButton.SetActive(true);
         TextMeshHome.SetActive(true);
         LeaderButton.SetActive(true);
         SettingsButton.SetActive(true);
         AccountBtnIcon.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
     }
 }
Beispiel #6
0
 void loadImage(int index)
 {
     PlayerPrefs.SetInt("avatar", 1);
     PlayerPrefs.SetInt("avatarindx", index);
     avatarpanel.SetActive(false);
     AvatarIcn.GetComponent <Image>().sprite = scrollshop.GetChild(index).GetChild(0).GetComponent <Image>().sprite;
     FbIcn.SetActive(false);
     AnonyIcn.SetActive(false);
     AvatarIcn.SetActive(true);
     foreach (Transform child in scrollavatar.transform)
     {
         Destroy(child.gameObject);
     }
     //Debug.Log("sadasdadsa");
     BtnAvatar.SetActive(true);
 }
Beispiel #7
0
 public void InfoPage(bool y)
 {
     if (y)
     {
         PlayScreen.SetActive(false);
         InfoButton.SetActive(false);
         ShopButton.SetActive(false);
         BtnAvatar.SetActive(false);
         BackToHomeButton.SetActive(true);
         InfoPanel.SetActive(true);
         TextMeshHome.SetActive(false);
     }
     else
     {
         PlayScreen.SetActive(true);
         InfoButton.SetActive(true);
         ShopButton.SetActive(true);
         BtnAvatar.SetActive(true);
         BackToHomeButton.SetActive(false);
         InfoPanel.SetActive(false);
         TextMeshHome.SetActive(true);
     }
 }