private void RefreshSaveData() { CampsiteData data = PlayerDataMgr.singleton.DB.campsiteData; if (data == null) { data = new CampsiteData(); } data.id = this.id; data.totalRewardVal = this.totalRewardVal; data.lastRecordTime = this.lastRecordTime; data.hasOfflineReward = this.hasOfflineReward; CampsitePointData[] pointsBuffer = data.points; if (data.points == null || data.points.Length != this.points.Length) { data.points = new CampsitePointData[this.points.Length]; } for (int i = 0; i < this.points.Length; i++) { CampsitePointData buffer = pointsBuffer != null && i < pointsBuffer.Length ? pointsBuffer[i] : new CampsitePointData(); this.points[i].FillSaveData(buffer); data.points[i] = buffer; } PlayerDataMgr.singleton.DB.campsiteData = data; PlayerDataMgr.singleton.NotifySaveData(); }
internal void FillSaveData(CampsitePointData buffer) { buffer.index = this.index; buffer.isUnlock = this.isUnlock; buffer.unlockStage = this.unlockStage; buffer.equipGunId = this.equipGunId; buffer.quickRewardTimes = this.quickRewardTimes; buffer.timer = this.timer; buffer.settlementReward_Nonauto = this.settlementReward_Nonauto; buffer.settlementReward_Auto = this.settlementReward_Auto; buffer.lv = this.lv; }
internal void LoadSaveData(CampsitePointData data) { this.isUnlock = data.isUnlock; this.unlockStage = data.unlockStage; this.equipGunId = data.equipGunId; this.quickRewardTimes = data.quickRewardTimes; this.timer = data.timer; this.settlementReward_Nonauto = data.settlementReward_Nonauto; this.settlementReward_Auto = data.settlementReward_Auto; this.lv = data.lv; RefreshCardData(); RefreshAutoState(); }