Example #1
0
 public Sample(SubSoundDef def)
 {
     subDef         = def;
     resolvedVolume = def.RandomizedVolume();
     resolvedPitch  = def.pitchRange.RandomInRange;
     startRealTime  = Time.realtimeSinceStartup;
     if (Current.ProgramState == ProgramState.Playing)
     {
         startTick = Find.TickManager.TicksGame;
     }
     else
     {
         startTick = 0;
     }
     foreach (SoundParamTarget_Volume item in subDef.paramMappings.Select((SoundParameterMapping m) => m.outParam).OfType <SoundParamTarget_Volume>())
     {
         volumeInMappings.Add(item, 0f);
     }
 }
Example #2
0
 public Sample(SubSoundDef def)
 {
     this.subDef         = def;
     this.resolvedVolume = def.RandomizedVolume();
     this.resolvedPitch  = def.pitchRange.RandomInRange;
     this.startRealTime  = Time.realtimeSinceStartup;
     if (Current.ProgramState == ProgramState.Playing)
     {
         this.startTick = Find.TickManager.TicksGame;
     }
     else
     {
         this.startTick = 0;
     }
     foreach (SoundParamTarget_Volume key in (from m in this.subDef.paramMappings
                                              select m.outParam).OfType <SoundParamTarget_Volume>())
     {
         this.volumeInMappings.Add(key, 0f);
     }
 }