예제 #1
0
 public void Scribe()
 {
     Scribe_Values.Look(ref enabled, "enabled", default(bool), true);
     TargetSelector.Look(ref targetSelector, "targetSelector");
     Scribe_Values.Look(ref interval, "interval", default(int), true);
     IntervalScale.Look(ref intervalScale, "intervalScale");
     Scribe_Values.Look(ref offset, "offset", default(int), true);
     IntervalScale.Look(ref offsetScale, "offsetScale");
 }
예제 #2
0
        // Custom save/load logic
        public static void Look(ref IntervalScale value, string label)
        {
            int id = value.id;

            Scribe_Values.Look(ref id, label, default(int), true);
            IntervalScale found = Values.FirstOrDefault((scale) => scale.id == id);

            if (found == null)
            {
                found = HOURS;                // Default value
            }
            value = found;
        }