Ejemplo n.º 1
0
 // 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;
 }
Ejemplo n.º 2
0
    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);
        }
    }