void OnDisable()
    {
        if (m_Respawn != null)
        {
            m_Respawn.respawnOccurredEvent -= OnRespawnOccured;
        }

        if (m_StatsContainer != null)
        {
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_EnergyInitialValue_StatId, OnEnergyInitialValueStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_EnergyRecoveryRate_StatId, OnEnergyRecoveryRateStatChanged);
        }
    }
    void OnDisable()
    {
        if (m_Respawn != null)
        {
            m_Respawn.respawnOccurredEvent += OnRespawnOccured;
        }

        if (m_StatsContainer != null)
        {
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_KickEnergyCost_StatId, OnEnergyCostStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_KickRadius_StatId, OnRadiusStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_KickCooldown_StatId, OnCooldownStatChanged);

            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_KickForce_StatId, OnKickForceStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_KickTackleForce_StatId, OnTackleForceStatChanged);
        }
    }
Ejemplo n.º 3
0
    void OnDisable()
    {
        // Force stop.

        {
            m_Running = false;
        }

        // Release callbacks.

        if (m_Respawn != null)
        {
            m_Respawn.respawnOccurredEvent -= OnRespawnOccurred;
        }

        if (m_StatsContainer != null)
        {
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_AttractEnergyCostRate_StatId, OnEnergyCostRateStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_AttractForce_StatId, OnForceMagnitudeStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_AttractRadius_StatId, OnRadiusStatChanged);
        }
    }
    void OnDisable()
    {
        if (m_StatsContainer != null)
        {
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_Mass_StatId, OnMassStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_Drag_StatId, OnDragStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_MovForce_StatId, OnAppliedForceStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_MaxSpeed_StatId, OnMaxSpeedStatChanged);

            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_DashMass_StatId, OnDashMassStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_DashDrag_StatId, OnDragStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_DashForce_StatId, OnDashAppliedForceStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_DashCooldown_StatId, OnDashCooldownStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_DashDuration_StatId, OnDashDurationStatChanged);
            m_StatsContainer.UnregisterHandler(tnTeamStatsId.s_DashEnergyCost_StatId, OnDashEnergyCostStatChanged);
        }

        if (m_Respawn != null)
        {
            m_Respawn.respawnOccurredEvent -= OnRespawnOccurred;
        }
    }