示例#1
0
    public PlayerData_script(PlayerInfoManager_script player)
    {
        Name    = player.Name;
        Credits = player.Credits;
        //DeckInventroy = new List<string>(player.DeckInventroy);

        SplitPlayerDeck(out CardString, out CardAmount, player);

        PartIndex = new List <int>(player.PartIndex);

        foreach (int p in PartIndex)
        {
            Debug.Log("part index: " + p);
        }

        ColorIndex = new List <int>(player.ColorIndex);

        foreach (int c in ColorIndex)
        {
            Debug.Log("color index: " + c);
        }

        Wins   = player.Wins;
        Loses  = player.Loses;
        Played = player.Played;

        MusicVolume = player.MusicVolume;
        SFXVolume   = player.SFXVolume;
    }
示例#2
0
    void Awake()
    {
        //LeftBoard = MainCanvas.transform.GetChild(1).GetChild(2).GetChild(4).GetComponent<TotalValueTracker_script>();
        //RightBoard = MainCanvas.transform.GetChild(1).GetChild(2).GetChild(5).GetComponent<TotalValueTracker_script>();
        _leftDeck  = LeftBoard.GetComponent <PlayerDeckMananger_script>();
        _rightDeck = RightBoard.GetComponent <PlayerDeckMananger_script>();

        _uiManager         = GetComponent <UIManager_script>();
        _globalDeckManager = GetComponent <GlobalDeckManager_script>();
        _playerInfoManager = _uiManager.PlayerInfoManager;
    }
示例#3
0
    public static void SaveData(PlayerInfoManager_script player)
    {
        BinaryFormatter bf = new BinaryFormatter();

        string     path   = Application.persistentDataPath + "/player.skm";
        FileStream stream = new FileStream(path, FileMode.Create);

        PlayerData_script playerData = new PlayerData_script(player);

        bf.Serialize(stream, playerData);

        stream.Close();
    }
示例#4
0
 private void SplitPlayerDeck(out List <string> cardInfo, out List <int> cardAmount, PlayerInfoManager_script player)
 {
     cardInfo   = new List <string>();
     cardAmount = new List <int>();
     foreach (PlayerInfoManager_script.DeckInventroyClass card in player.PlayerDeck)
     {
         cardInfo.Add(card.CardInfo);
         cardAmount.Add(card.CardAmount);
     }
 }