Example #1
0
 public static void Play(SfxInfo info, Transform source = null, bool mpSync = true)
 {
     if (Sfx.Instance)
     {
         Sfx.Play(info._sfx, source, mpSync);
     }
 }
Example #2
0
 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);
     }
 }
Example #3
0
        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);
        }