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); } }
public void Stop() { remainingTime = 0f; if (Source != null) { Source.Stop(); } VRC_Trigger.TriggerCustom(OnStop); }
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"); } }
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); }