void OnCurrentWeaponIndexChanged(int value)
    {
        if (m_Weapons.Count <= 0)
        {
            PlayerWeapon obj = GetComponentInChildren <PlayerWeapon>();
            if (obj)
            {
                UpdateWeaponList(obj.gameObject);
            }
            return;
        }

        if (m_Weapons.Count <= value)
        {
            return;
        }

        m_CurrentWeaponIndex = value;

        if (m_CurrentWeapon)
        {
            m_CurrentWeapon.gameObject.SetActive(false);
        }

        m_CurrentWeapon = m_Weapons[value];
        m_CurrentWeapon.gameObject.SetActive(true);
        m_CurrentShotEffect = m_ShotEffects[value];

        if (isLocalPlayer)
        {
            UpdateUI();
        }
    }
Beispiel #2
0
    //[ServerCallback]
    protected virtual void Start()
    {
        m_ShotEffects = GetComponentInChildren <ShotEffects>();
        OnAmmoChanged(m_MaxAmmo - m_MaxMagazine);
        OnMagazineChanged(m_MaxMagazine);

        NetworkPlayer player = GetComponentInParent <NetworkPlayer>();

        m_PlayerName = player.m_PlayerName;

        FindScoreManager();
    }