Exemple #1
0
        //This is hooked into the powerupDistance syncvar, and will fire whenever this value updates from server.
        void OnBoostChange(float newPowerupDistance)
        {
            m_PowerupDistance = newPowerupDistance;

            //We only want nitro particles to be enabled if we have nitro in the tank, and if the tank's not been frozen due to round end.
            m_TankDisplay.SetNitroParticlesActive((newPowerupDistance > 0f) && (m_Speed > 0));

            if (nitroChanged != null)
            {
                nitroChanged(m_PowerupDistance / m_MaxPowerupDistance);
            }
        }
Exemple #2
0
        //Fired on clients via RPC to perform death cleanup.
        private void InternalOnZeroHealth()
        {
            //Disable any active powerup SFX
            m_ShieldLevel = 0f;
            m_TankDisplay.SetShieldBubbleActive(false);
            m_TankDisplay.SetNitroParticlesActive(false);

            // Disable the collider and all the appropriate child gameobjects so the tank doesn't interact or show up when it's dead.
            SetTankActive(false);

            if (m_CurrentSpawnPoint != null)
            {
                m_CurrentSpawnPoint.Decrement();
            }

            if (playerDeath != null)
            {
                playerDeath();
            }
        }