protected override void DoRead(StateBinaryReader reader, VehicleSchedule schedule, VehicleScheduleData data) { base.DoRead(reader, schedule, data); _startDistance = null; if (ScheduleStopwatch.GetSchemaVersion(typeof(VehicleScheduleData)) >= 2) { if (reader.ReadBool()) { _startDistance = reader.ReadFloat(); } } }
protected override void DoRead(StateBinaryReader reader, VehicleSchedule schedule) { base.DoRead(reader, schedule); if (ScheduleStopwatch.GetSchemaVersion(typeof(TaskDurationDataSet)) >= 2) { int count = reader.ReadInt(); for (int i = 0; i < count; i++) { int taskIndex = reader.ReadInt(); float value = reader.ReadFloat(); if (taskIndex > -1) { _distanceData.Add(schedule.GetTasks()[taskIndex], value); } else { ScheduleStopwatch.logger.Log(UnityEngine.LogType.Warning, "RootTask index = -1"); } } } }