SoundUtils.cs 276 B

1234567891011121314151617
  1. using UnityEngine;
  2. using System;
  3. public class SoundUtils
  4. {
  5. public static Camera gameCamera;
  6. public static bool IsSoundNear(Vector3 origin)
  7. {
  8. if(NumberUtil.distanceVector3(origin, gameCamera.transform.position, true) < 20f)
  9. {
  10. return true;
  11. }
  12. return false;
  13. }
  14. }