// Start is called before the first frame update private void Start() { player = FindObjectOfType <LynBeatEmUp>(); HealthUI.maxValue = player.MaxHealth; HealthUI.value = HealthUI.maxValue; PlayerName.text = player.Name; PlayerSprite.sprite = player.LynSprite; }
private void OnTriggerEnter(Collider other) { Enemy enemy = other.GetComponent <Enemy>(); LynBeatEmUp player = other.GetComponent <LynBeatEmUp>(); if (enemy != null) { enemy.TookDamage(damage); } if (player != null) { player.TookDamage(damage); } }