public static void Play(SfxInfo info, Transform source = null, bool mpSync = true) { if (Sfx.Instance) { Sfx.Play(info._sfx, source, mpSync); } }
private void OnCollisionEnter(Collision other) { if (!this._playedEvent && other.gameObject.CompareTag("Player") && other.relativeVelocity.sqrMagnitude > 25f) { this._playedEvent = true; Sfx.Play(this, base.transform, true); base.Invoke("Reset", (float)this._resetDelay); } }
public static bool TryPlay <T>(Collider col, Transform source = null, bool mpSync = true) where T : SfxInfo { SfxInfo sfxInfo = col.GetComponent <T>(); if (sfxInfo) { Sfx.Play(sfxInfo, (!source) ? col.transform : source, mpSync); } return(sfxInfo); }