public void ExperienceAward() { if (_baseStatsGetter == null || !_playerMarker) { return; } Experience playerExperience = _playerMarker.GetComponent <Experience>(); playerExperience.GainExperience(_baseStatsGetter.GetStat(Stat.ExperienceReward)); }
private void Awake() { _player = FindObjectOfType <PlayerMarker>(); _playerMaxXpHandler = _player?.GetComponent <PlayerMaxXpHandler>(); _experience = _player?.GetComponent <Experience>(); }
private void Awake() { _playerMarker = FindObjectOfType <PlayerMarker>(); _playerXpLevelHandler = _playerMarker?.GetComponent <PlayerXpLevelHandler>(); gameCurrentLevel = _playerXpLevelHandler.CurrentLevel; }
void Awake() { _player = FindObjectOfType <PlayerMarker>(); _experience = _player?.GetComponent <Experience>(); _xpText = GetComponent <TextMeshProUGUI>(); }
void Awake() { _player = FindObjectOfType <PlayerMarker>(); _playerMaxXpHandler = _player?.GetComponent <PlayerMaxXpHandler>(); _xpText = GetComponent <TextMeshProUGUI>(); }
void Awake() { _player = FindObjectOfType <PlayerMarker>(); _health = _player?.GetComponent <Health>(); _healthText = GetComponent <TextMeshProUGUI>(); }
//this method could be overriden in a subclass to implement specific pickups //as an example, this is an ammo pickup protected virtual void Pick(PlayerMarker player) { Debug.Log("Picked up"); player.GetComponent <PlayerAttack>().Weapon.Ammo += 10; }