コード例 #1
0
    /// <summary>
    /// re-caches all of the standard UFPS local player components
    /// </summary>
    private static void RefreshPlayerComponents()
    {
        m_FPCamera        = null;
        m_FPController    = null;
        m_FPInput         = null;
        m_FPDamageHandler = null;
        m_FPWeaponHandler = null;
        m_Inventory       = null;
        m_Respawner       = null;
        m_FPBodyAnimator  = null;
        m_RagdollHandler  = null;
        m_FootFXHandler   = null;

        if (m_FPEventHandler == null)
        {
            return;
        }

        m_FPCamera        = m_FPEventHandler.GetComponentInChildren <vp_FPCamera>();
        m_FPController    = m_FPEventHandler.GetComponentInChildren <vp_FPController>();
        m_FPInput         = m_FPEventHandler.GetComponentInChildren <vp_FPInput>();
        m_FPDamageHandler = m_FPEventHandler.GetComponentInChildren <vp_FPPlayerDamageHandler>();
        m_FPWeaponHandler = m_FPEventHandler.GetComponentInChildren <vp_FPWeaponHandler>();
        m_Inventory       = m_FPEventHandler.GetComponentInChildren <vp_PlayerInventory>();
        m_Respawner       = m_FPEventHandler.GetComponentInChildren <vp_PlayerRespawner>();
        m_FPBodyAnimator  = m_FPEventHandler.GetComponentInChildren <vp_FPBodyAnimator>();
        m_RagdollHandler  = m_FPEventHandler.GetComponentInChildren <vp_RagdollHandler>();
        m_FootFXHandler   = m_FPEventHandler.GetComponentInChildren <vp_PlayerFootFXHandler>();
    }