private static void GetParentAndSpawnSchedule(ref Schedule schedule, out Schedule parentSchedule) { parentSchedule = schedule.ReferencedSchedule(); if (parentSchedule == null) { parentSchedule = schedule; Schedule spawn = Schedule.RetrieveSpawnedSchedule(parentSchedule.IdSchedule, parentSchedule.StartTime); if (spawn != null) { schedule = spawn; } } }