コード例 #1
0
 private void PlayRandomomponent(ComponentInstance zComponentInstance)
 {
     if (_playMode == RandomComponentPlayMode.Random)
     {
         int index = _shuffleBag.get();
         _selectedComponent = _components[index];
     }
     else
     {
         int num = -1;
         if (!_shareRandomNoRepeatHistory)
         {
             num = GetNextRandomNoRepeatIndex();
         }
         else
         {
             RandomComponent randomComponent = base.ComponentHolder as RandomComponent;
             if ((bool)randomComponent)
             {
                 num = randomComponent.GetNextRandomNoRepeatIndex();
             }
         }
         if (num < 0)
         {
             return;
         }
         _selectedComponent = _components[num];
     }
     if (_selectedComponent != null)
     {
         _selectedComponent.PlayInternal(zComponentInstance, 0f, 0.5f);
     }
 }
コード例 #2
0
 private void PlayRandomomponent(ComponentInstance zComponentInstance)
 {
     if (_playMode == RandomComponentPlayMode.Random)
     {
         int num = _shuffleBag.get();
         _selectedAudioClip = _audioClips[num];
     }
     else
     {
         int num2 = -1;
         if (!_shareRandomNoRepeatHistory)
         {
             num2 = GetNextRandomNoRepeatIndex();
         }
         else
         {
             RandomAudioClipComponent randomAudioClipComponent = base.ComponentHolder as RandomAudioClipComponent;
             if ((bool)randomAudioClipComponent)
             {
                 num2 = randomAudioClipComponent.GetNextRandomNoRepeatIndex();
             }
         }
         if (num2 < 0)
         {
             return;
         }
         _selectedAudioClip = _audioClips[num2];
     }
     if (_selectedAudioClip != null)
     {
         base.AudioClip = _selectedAudioClip;
         base.PlayInternal(zComponentInstance, 0f, 0.5f, dontPlayComponents: false);
     }
 }