Example #1
0
        public void Init(CarBase car)
        {
            _audioService = Core.Instance.GetService <AudioService>();
            Assert.AreNotEqual(null, _audioService);

            #region createing nitro audio emitter

            _audioService.CreateEmitterNitro();
            #endregion
            _audioService.CreateEmitterNitroEmpty();

            _playerCar = car;

            maxNitro  = (float)Math.Round(NitroDuration / Time.fixedDeltaTime, 0);
            nitroPlus = (float)Math.Round(nitroMinus / NitroRecovery, 2);

            nitroDelayMax = (float)Math.Round(NitroDelay / Time.fixedDeltaTime, 0);

            m_rigidbody = GetComponent <Rigidbody>();

            nitroCurrent = maxNitro;
        }