コード例 #1
0
    /// <summary>
    /// Lấy số Gold hiện tại
    /// </summary>
    public int LoadGold()
    {
        string gold = ReadWriteFileText.GetStringFromPrefab(Data._Gold);

        if (gold != "")
        {
            return(int.Parse(gold));
        }
        return(0);
    }
コード例 #2
0
    // Use this for initialization
    void Awake()
    {
        string sound = ReadWriteFileText.GetStringFromPrefab(Data._LinkSound);

        if (sound == "")
        {
            _GameControler = FindObjectOfType <GameControler>();
            _GameControler._GameState._Music = true;
            _GameControler._GameState._Sound = true;
        }
        else
        {
            string[] arrSound = sound.Split('#');
            _GameControler._GameState._Music = bool.Parse(arrSound[0]);
            _GameControler._GameState._Sound = bool.Parse(arrSound[1]);
        }
    }
コード例 #3
0
    /// <summary>
    /// Load danh sách súng player
    /// </summary>
    public void LoadStatePickPlayer()
    {
        string strPick = ReadWriteFileText.GetStringFromPrefab(Data._LinkPic);

        if (strPick == "")
        {
            strPick = "1*1*1*0*1*0*0*0*1*0*0*1*0*0*0*1*0*0";
        }
        string[] arrPick = strPick.Split('*');
        string[] arrAmmo = Data._LinkAmmo.Split('*');
        _GameControler._ListStatePickPlayer = new Pick[arrPick.Length];
        for (int i = 0; i < arrPick.Length; i++)
        {
            string state = arrPick[i] == "1" ? "true" : "false";
            Pick   pic   = new Pick(i, int.Parse(arrAmmo[i]), bool.Parse(state));
            _GameControler._ListStatePickPlayer[i] = pic;
        }
    }