Exemple #1
0
    private void LocateAndLinkPlayer()
    {
        var p = FindObjectOfType <PlayerController>();

        player = p.GetComponent <Unit>();

        healthBar.Link(player.healthPoints);
    }
Exemple #2
0
    private void FindAndLinkBoss()
    {
        ResetState();

        linkRef = GameObject.FindGameObjectWithTag("Boss")?.GetComponent <Unit>();
        if (linkRef != null)
        {
            hpBar.Link(linkRef.healthPoints);
            txtName.text        = linkRef.data.name;
            txtDamageTaken.text = "";
            c.enabled           = true;


            linkRef.healthPoints.OnChanged += ChangeListener;
        }
    }