Ejemplo n.º 1
0
 public void btnSound_Click()
 {
     if (_GameControler._GameState._Sound)
     {
         _GameControler._GameState._Sound = false;
     }
     else
     {
         _GameControler._GameState._Sound = true;
     }
     ReadWriteFileText.SaveStringToPrefab(Data._LinkSound, _GameControler._GameState._Music + "#" + _GameControler._GameState._Sound);
     if (_GameControler._GameState._Sound)
     {
         _ListButton[1].color = Color.white;
     }
     else
     {
         _ListButton[1].color = Color.grey;
     }
 }
Ejemplo n.º 2
0
 public void btnMusic_Click()
 {
     if (_GameControler._GameState._Music)
     {
         _GameControler._GameState._Music = false;
         _BgSound.PlayBackground(false);
     }
     else
     {
         _GameControler._GameState._Music = true;
         _BgSound.PlayBackground(true);
     }
     ReadWriteFileText.SaveStringToPrefab(Data._LinkSound, _GameControler._GameState._Music + "#" + _GameControler._GameState._Sound);
     if (_GameControler._GameState._Music)
     {
         _ListButton[0].color = Color.white;
     }
     else
     {
         _ListButton[0].color = Color.grey;
     }
 }
    public void SetPopup(int _Team)
    {
        _GameControler = FindObjectOfType <GameControler>();
        _UIManager     = FindObjectOfType <UIManager>();
        if (_Team == 0)//Green thắng
        {
            _imgTeam[0].SetActive(true);
            _imgTeam[1].SetActive(false);
            if (_GameControler._TypeGame == 0)
            {
                _imgMedal[0].SetActive(true);
                _imgMedal[1].SetActive(true);
                _imgMedal[2].SetActive(true);
                //======
                int numStar = _GameControler._NumberPlayer;
                if (numStar > 3)
                {
                    numStar = 3;
                }
                GameObject[] arrPlayer = GameObject.FindGameObjectsWithTag("Player");
                int          a         = _GameControler._NumberPlayer - arrPlayer.Length;
                numStar -= a;
                if (numStar < 1)
                {
                    numStar = 1;
                }
                if (numStar == 1)
                {
                    _imgMedal[0].GetComponent <Image>().sprite = _SpriteMedal[0];
                    _imgMedal[1].GetComponent <Image>().sprite = _SpriteMedal[1];
                    _imgMedal[2].GetComponent <Image>().sprite = _SpriteMedal[1];
                }
                else if (numStar == 2)
                {
                    _imgMedal[0].GetComponent <Image>().sprite = _SpriteMedal[0];
                    _imgMedal[1].GetComponent <Image>().sprite = _SpriteMedal[0];
                    _imgMedal[2].GetComponent <Image>().sprite = _SpriteMedal[1];
                }
                else
                {
                    _imgMedal[0].GetComponent <Image>().sprite = _SpriteMedal[0];
                    _imgMedal[1].GetComponent <Image>().sprite = _SpriteMedal[0];
                    _imgMedal[2].GetComponent <Image>().sprite = _SpriteMedal[0];
                }
                //=============
                ReadWriteFileText.SaveStringToPrefab(Data._Gold, (_GameControler._Gold + numStar) + "");
                _GameControler._Gold += numStar;
                string strPick = "1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1";
                if (_GameControler._Gold >= 90)
                {
                    strPick = "1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1";
                }
                else if (_GameControler._Gold >= 60)
                {
                    strPick = "1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*0*1";
                }
                else if (_GameControler._Gold >= 45)
                {
                    strPick = "1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*0*0";
                }
                else if (_GameControler._Gold >= 32)
                {
                    strPick = "1*1*1*1*1*1*1*1*1*1*1*1*1*1*0*1*0*0";
                }
                else if (_GameControler._Gold >= 24)
                {
                    strPick = "1*1*1*1*1*1*1*1*1*1*1*1*1*0*0*1*0*0";
                }
                else if (_GameControler._Gold >= 18)
                {
                    strPick = "1*1*1*1*1*1*1*0*1*1*1*1*1*0*0*1*0*0";
                }
                else if (_GameControler._Gold >= 12)
                {
                    strPick = "1*1*1*1*1*1*0*0*1*1*1*1*1*0*0*1*0*0";
                }
                else if (_GameControler._Gold >= 7)
                {
                    strPick = "1*1*1*0*1*1*0*0*1*1*1*1*1*0*0*1*0*0";
                }
                else if (_GameControler._Gold >= 3)
                {
                    strPick = "1*1*1*0*1*1*0*0*1*0*1*1*1*0*0*1*0*0";
                }
                else if (_GameControler._Gold >= 1)
                {
                    strPick = "1*1*1*0*1*1*0*0*1*0*1*1*0*0*0*1*0*0";
                }
                else
                {
                    strPick = "1*1*1*0*1*0*0*0*1*0*0*1*0*0*0*1*0*0";
                }
                ReadWriteFileText.SaveStringToPrefab(Data._LinkPic, strPick);
            }
            else
            {
                _imgMedal[0].SetActive(false);
                _imgMedal[1].SetActive(false);
                _imgMedal[2].SetActive(false);
            }
        }
        else
        {
            _imgTeam[0].SetActive(false);
            _imgTeam[1].SetActive(true);
            //===========
            _imgMedal[0].SetActive(false);
            _imgMedal[1].SetActive(false);
            _imgMedal[2].SetActive(false);
        }


        //???
        if (GameServices.IsInitialized())
        {
            GameServices.ReportScore(_GameControler._Gold, EM_GameServicesConstants.Leaderboard_Medals);
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Thực hiện mở khóa pick
    /// </summary>
    public void UnlockPick()
    {
        string strPick = "1*1*1*0*1*0*0*0*1*0*0*1*0*0*0*1*0*0";

        ReadWriteFileText.SaveStringToPrefab(Data._LinkPic, strPick);
    }