Пример #1
0
    void Start()
    {
        // sets healthbar to the initial value
        healthBar.SetHealth(health);

        spriteRenderer = transform.Find("Sprite").GetComponent <SpriteRenderer> ();
        weapon         = transform.Find("Weapon").GetComponent <Weapon>();
        if (weapon == null)
        {
            Debug.Log("No player weapon.");
        }

        defaultPosition = transform.position;
    }
Пример #2
0
 public override void UpdateHealthBar(Character player)
 {
     hpMan.SetHealth(player.GetStat(EntityLiving.Stat.MAX_HEALTH), player.Health);
 }