Ejemplo n.º 1
0
    public GPlayerChess Spawn(PlayerChessData data)
    {
        GPlayerChess chess = Spawn(data.prototype);

        chess.InitWithSaveData(data);
        return(chess);
    }
Ejemplo n.º 2
0
 public void InitWithSaveData(PlayerChessData data)
 {
     Debug.Assert(data.prototype == prefabPrototype);
     useSaveData = true;
     skills.Clear();
     foreach (PlayerSkillData skillData in data.skills)
     {
         skills.Add(PlayerSkill.CreateInstanceFromSaveData(skillData));
     }
 }
Ejemplo n.º 3
0
    public PlayerChessData GetSaveData()
    {
        PlayerChessData res = new PlayerChessData();

        res.prototype = prefabPrototype;
        foreach (PlayerSkill skill in skills)
        {
            res.skills.Add(skill.GetSaveData());
        }
        return(res);
    }