Пример #1
0
    public IEnumerator Start()
    {
        animator    = character.GetComponent <Animator>();
        audioSource = character.GetComponent <AudioSource>();

        ammoCount = Mathf.Clamp(weaponData.GetInitalAmmoCount(), 0, weaponData.GetAmmoClip());
        firedLast = 0;

        yield return(new WaitForSeconds(0.1f));

        if (weaponData.GetInitalAmmoCount() > weaponData.GetAmmoClip())
        {
            Player.Instance.GiveAmmo(weaponData.GetAmmoType(), weaponData.GetInitalAmmoCount() - ammoCount);
        }
    }