예제 #1
0
 private void HandleCallbackTrigger(VRC_Trigger trigger, VRC_EventHandler.VrcEvent e)
 {
     if (trigger != null && !string.IsNullOrEmpty(e.ParameterString))
     {
         VRC_Trigger.TriggerCustom(trigger.get_gameObject(), e.ParameterString);
     }
 }
예제 #2
0
 public void Stop()
 {
     remainingTime = 0f;
     if (Source != null)
     {
         Source.Stop();
     }
     VRC_Trigger.TriggerCustom(OnStop);
 }
예제 #3
0
        private void play(int idx)
        {
            Stop();
            current = idx;
            AudioClip val = Current;

            if (val != null)
            {
                if (Source != null)
                {
                    Source.set_pitch(Random.Range(MinPitchRange, MaxPitchRange));
                    Source.PlayOneShot(val);
                }
                remainingTime = val.get_length();
                VRC_Trigger.TriggerCustom(OnPlay);
            }
            else if (Clips.Length > 0 && Clips[playOrder[current]] == null)
            {
                Debug.LogError((object)"Failed to play because clip was null");
            }
        }
예제 #4
0
        public void PlayNext()
        {
            int num = current;

            switch (PlaybackOrder)
            {
            case Order.InOrder:
            case Order.Shuffle:
                num = ((num < playOrder.Length) ? (num + 1) : 0);
                break;

            case Order.InOrderReversing:
                if (num < playOrder.Length)
                {
                    num++;
                }
                else
                {
                    for (int j = 0; j < playOrder.Length; j++)
                    {
                        int num2 = playOrder[j];
                        playOrder[j] = playOrder[playOrder.Length - j - 1];
                        playOrder[playOrder.Length - j - 1] = num2;
                    }
                    num = 0;
                }
                break;

            case Order.Random:
                num = (from i in playOrder
                       orderby rng.Next()
                       select i).First();
                break;
            }
            VRC_Trigger.TriggerCustom(OnChange);
            play(num);
        }