void Start() { playerBaseHealth = FindObjectOfType <PlayerBaseHealth>(); pathFinder = FindObjectOfType <PathFinder>(); var path = pathFinder.GetPath(); StartCoroutine(FollowPath(path)); }
protected override void HitOpponent(Collider opponent) { PlayerBaseHealth player = opponent.GetComponent <PlayerBaseHealth>(); if (player) { player.GetDamage(Damage); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { PlayerBaseHealth playerHealth = other.GetComponent <PlayerBaseHealth>(); if (playerHealth) { playerHealth.GetDamage(_collisionDamage); _health.DieFromCollision(); } }
void Awake() { if (_instance == null) { _instance = this; } else if (_instance == this) { Destroy(gameObject); } _scoreManager = GetComponent <ScoreManager>(); _scoreManager.SetGuiScript(_gui); PlayerBaseHealth playerHealth = _player.GetComponent <PlayerBaseHealth>(); if (playerHealth != null) { playerHealth.OnDie += EndGame; } }
private void Awake() { _playerHealth = GetComponent <PlayerBaseHealth>(); _playerWeapon = GetComponent <PlayerWeapon>(); }
private void Start() { baseHealth = FindObjectOfType <PlayerBaseHealth>(); enemySpawnCounter = FindObjectOfType <EnemySpawner>(); }