// Start is called before the first frame update void Start() { currentAmmo = ammoCapacity; ingameui = GameObject.FindGameObjectWithTag("InGameUI").GetComponent <InGameUI>(); myanim = gameObject.GetComponent <Animator>(); castPointStart = CastPoint.transform; ingameui.SetAmmo(currentAmmo); }
private void UpdateUI() { if (!inGameUI) { return; } inGameUI.SetAmmo(ammo.GetAmmo(type)); }
// Update is called once per frame void Update() { ingameui.SetAmmo(currentAmmo); float horizontal = Input.GetAxis("Horizontal"); float vertical = Input.GetAxis("Vertical"); if (Input.GetButton("Run")) { if (vertical == 1) { vertical = 2; } } myanim.SetFloat("walk", vertical / 2); if (currentAmmo <= 0 && reload != true && shoot != true)/////////////фикс { Reload(); } if (GameManager.instance.IsAlive && GameManager.instance.menuOn == false) { UserInput(); } }