// [TypeInfo RVA: 0x0]
public class Distance2DAmbience : MonoBehaviour
{
	public UnityEngine.Transform player; // 0x20
	public float maxDistance; // 0x28
	public float minDistance; // 0x2C
	public float maxVolume; // 0x30
	public float fadeSpeed; // 0x34
	private UnityEngine.AudioSource source; // 0x38

	// RVA: 0x31F128C VA: 0x78188DC28C
	private void Awake();
	/*
	 *   undefined *puVar1;
	 *   bool bVar2;
	 *   void *pvVar3;
	 *   void **ppvVar4;
	 *   long lVar5;
	 *
	 *   puVar1 = PTR_DAT_070c0730;
	 *   if ((DAT_0754a710 & 1) == 0) {
	 *     func_0x031fdc8c(PTR_DAT_070c0730);
	 *     DAT_0754a710 = 1;
	 *   }
	 *   pvVar3 = (void *)func_0x0373df50(this,*(undefined8 *)puVar1);
	 *   ppvVar4 = &this.source;
	 *   *ppvVar4 = pvVar3;
	 *   func_0x031fdc38(ppvVar4,pvVar3);
	 *   if (*ppvVar4 != null) {
	 *     UnityEngine.AudioSource.set_spatialBlend(*ppvVar4,0.0);
	 *     if (*ppvVar4 != null) {
	 *       UnityEngine.AudioSource.set_loop(*ppvVar4,true);
	 *       if (*ppvVar4 != null) {
	 *         bVar2 = UnityEngine.AudioSource.get_isPlaying(*ppvVar4);
	 *         if (bVar2) {
	 *           return;
	 *         }
	 *         pvVar3 = *ppvVar4;
	 *         if (pvVar3 != null) {
	 *           if ((bRam000000000755d742 & 1) == 0) {
	 *             func_0x031fdc8c(PTR_DAT_0714e1b0);
	 *             func_0x031fdc8c(PTR_DAT_070c6e98);
	 *             bRam000000000755d742 = 1;
	 *           }
	 *           if (pvVar3 != null) {
	 *             lVar5 = *(long *)((long)pvVar3 + 0x10);
	 *             if (lVar5 == 0) {
	 *               UnityEngine.Bindings.ThrowHelper.ThrowArgumentNullException(pvVar3,*(void **)PTR_DAT_070c6e98);
	 *             }
	 *             if (pcRam000000000755d770 == null) {
	 *               pcRam000000000755d770 = (code *)func_0x031fdc50(&UNK_0138b07d);
	 *             }
	 *             (*pcRam000000000755d770)(lVar5,0);
	 *             return;
	 *           }
	 *           UnityEngine.Bindings.ThrowHelper.ThrowArgumentNullException(null,*(void **)PTR_DAT_070c6e98);
	 *           IL2CPP.ThrowNullReferenceException();
	 *         }
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x31F1340 VA: 0x78188DC340
	private void Update();
	/*
	 *   void *pvVar1;
	 *   long lVar2;
	 *   float fVar3;
	 *   float fVar4;
	 *   float fVar5;
	 *   float fVar6;
	 *   float fVar7;
	 *   UnityEngine_Vector3 UVar8;
	 *   UnityEngine_Vector3 UVar9;
	 *
	 *   if (this.player != null) {
	 *     UVar8 = UnityEngine.Transform.get_position(this.player);
	 *     pvVar1 = UnityEngine.Component.get_transform(this);
	 *     if (pvVar1 != null) {
	 *       UVar9 = UnityEngine.Transform.get_position(pvVar1);
	 *       if (cRam000000000754a7c9 == '\0') {
	 *         func_0x031fdc8c(typeinfo_ptr_mscorlib_Math_6FC0738);
	 *         cRam000000000754a7c9 = '\x01';
	 *       }
	 *       if (*(int *)(*(long *)typeinfo_ptr_mscorlib_Math_6FC0738 + 0xe4) == 0) {
	 *         func_0x031fde08();
	 *       }
	 *       fVar3 = UVar8.y - UVar9.y;
	 *       fVar5 = UVar8.x - UVar9.x;
	 *       fVar7 = UVar8.z - UVar9.z;
	 *       fVar6 = this.minDistance;
	 *       fVar3 = SQRT(fVar7 * fVar7 + fVar5 * fVar5 + fVar3 * fVar3);
	 *       if (fVar3 <= fVar6) {
	 *         fVar5 = this.maxVolume;
	 *       }
	 *       else {
	 *         fVar5 = 0.0;
	 *         if (fVar3 < this.maxDistance) {
	 *           fVar5 = (1.0 - (fVar3 - fVar6) / (this.maxDistance - fVar6)) * this.maxVolume;
	 *         }
	 *       }
	 *       pvVar1 = this.source;
	 *       if (pvVar1 != null) {
	 *         fVar6 = UnityEngine.AudioSource.get_volume(pvVar1);
	 *         fVar7 = UnityEngine.Time.get_deltaTime();
	 *         fVar7 = fVar7 * this.fadeSpeed;
	 *         fVar3 = 1.0;
	 *         if (fVar7 <= 1.0) {
	 *           fVar3 = fVar7;
	 *         }
	 *         fVar4 = 0.0;
	 *         if (0.0 <= fVar7) {
	 *           fVar4 = fVar3;
	 *         }
	 *         if ((bRam000000000755d748 & 1) == 0) {
	 *           func_0x031fdc8c(PTR_DAT_0714e1b0,0);
	 *           bRam000000000755d748 = 1;
	 *         }
	 *         if (pvVar1 != null) {
	 *           lVar2 = *(long *)((long)pvVar1 + 0x10);
	 *           if (lVar2 == 0) {
	 *             UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(pvVar1);
	 *           }
	 *           if (pcRam000000000755d7a0 == null) {
	 *             pcRam000000000755d7a0 = (code *)func_0x031fdc50(&UNK_0136db23);
	 *           }
	 *           (*pcRam000000000755d7a0)(fVar6 + (fVar5 - fVar6) * fVar4,lVar2);
	 *           return;
	 *         }
	 *         IL2CPP.ThrowNullReferenceException();
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x31F14A4 VA: 0x78188DC4A4
	public void .ctor();
	/*
	 *   undefined8 uVar1;
	 *   undefined4 uVar2;
	 *   undefined *puVar3;
	 *   undefined8 uVar4;
	 *
	 *   uVar1 = _UNK_0134b770;
	 *   uVar2 = _UNK_0134b77c;
	 *   this.maxVolume = (float)_UNK_0134b778;
	 *   uVar4 = _UNK_0134b770;
	 *   this.fadeSpeed = (float)uVar2;
	 *   _UNK_0134b770 = (undefined4)uVar1;
	 *   _UNK_0134b774 = SUB84(uVar1,4);
	 *   uVar2 = _UNK_0134b774;
	 *   this.maxDistance = (float)_UNK_0134b770;
	 *   _UNK_0134b770 = uVar4;
	 *   puVar3 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   this.minDistance = (float)uVar2;
	 *   if ((bRam000000000755f76f & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8,0);
	 *     bRam000000000755f76f = 1;
	 *   }
	 *   if (*(int *)(*(long *)puVar3 + 0xe4) == 0) {
	 *     func_0x031fde08();
	 *   }
	 *   return;
	 */
}
