ProjectStorms.ShipPartDestroy.TestShipDestroyed C# (CSharp) Méthode

TestShipDestroyed() private méthode

Tests the conditions necessary for ship destruction.
private TestShipDestroyed ( ShipPart a_part ) : void
a_part ShipPart Ship part being destroyed.
Résultat void
        private void TestShipDestroyed(ShipPart a_part)
        {
            if (a_part.partType == EShipPartType.LEFT_BALLOON)
            {
                // Apply balloon explosion
                m_rb.AddForceAtPosition(m_trans.up * balDestForce, a_part.partObject.transform.position);
                InputManager.SetControllerVibrate(gameObject.tag, balDestRumbleStr, 0.0f, balDestRumbleDurr, true);

                m_balLeftDest = true;
            }
            else if (a_part.partType == EShipPartType.RIGHT_BALLOON)
            {
                // Apply balloon explosion
                m_rb.AddForceAtPosition(m_trans.up * balDestForce, a_part.partObject.transform.position);
                InputManager.SetControllerVibrate(gameObject.tag, 0.0f, balDestRumbleStr, balDestRumbleDurr, true);

                m_balRightDest = true;
            }
            if (m_balLeftDest && m_balRightDest)
            {
                // Kill the player
                m_shipStates.SetPlayerState(EPlayerState.Dying);
            }

            if (!balloonPopNoise.isPlaying)
            {
                //balloonPopNoise.pitch = Random.RandomRange(-0.75f, 1.25f);
                balloonPopNoise.Play();
            }
        }