void Start() { newRigidbody = GetComponent <Rigidbody2D>(); myAnimator = gameObject.GetComponent <Animator>(); slider.value = PlayerModel.CalculateHealth(); currentWeapon = pistol; currentWeaponModel = pistolModel; weapon = PlayerModel.SwitchWeapon((int)PlayerModel.SelectedWeapon); }
private void FixedUpdate() { slider.value = PlayerModel.CalculateHealth(); numberOfCoins.text = PlayerModel.Coins.ToString(); numberOfFirstAidKits.text = PlayerModel.AvailableFirstAidKits.ToString(); numberOfGrenades.text = PlayerModel.AvailableGrenades.ToString(); ammo.text = $"Ammo: {weapon.GetWeaponAmmo()}"; OpenQuests(); if (startBlinking) { StartBlinking(); } if (PlayerModel.Health <= 0) { /*SavingService.LoadGame("newCheckpoint.json");*/ PlayerModel.ReloadCheckpoint(gameObject); } }