While our enemy mechanic has come a long way, it's still anti-climactic to have nothing happen when the Enemy prefab collides with the Player prefab. To fix this, we'll tie in the new enemy mechanics with the game manager.
Update PlayerBehavior with the following code and hit Play:
public class PlayerBehavior : MonoBehaviour
{
// ... No changes to public variables needed ...
private float _vInput;
private float _hInput;
private Rigidbody _rb;
private CapsuleCollider _col;
// 1
private GameBehavior _gameManager;
void Start()
{
_rb = GetComponent<Rigidbody>();
_col = GetComponent<CapsuleCollider>();
// 2
_gameManager = GameObject.Find("Game
Manager").GetComponent<GameBehavior>();
}
/* ... No changes to Update,
FixedUpdate, or
IsGrounded ... */
// 3
void OnCollisionEnter...