public GPlayerChess Spawn(PlayerChessData data) { GPlayerChess chess = Spawn(data.prototype); chess.InitWithSaveData(data); return(chess); }
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)); } }
public PlayerChessData GetSaveData() { PlayerChessData res = new PlayerChessData(); res.prototype = prefabPrototype; foreach (PlayerSkill skill in skills) { res.skills.Add(skill.GetSaveData()); } return(res); }