Exemplo n.º 1
0
    void Awake()
    {
        totalHealth      = health;
        criticalHud      = healthHUD.Find("Bloodframe").GetComponent <BlinkHUD>();
        healthBar        = healthHUD.Find("HealthBar/Bar").GetComponent <RectTransform>();
        placeHolderBar   = healthHUD.Find("HealthBar/Placeholder").GetComponent <RectTransform>();
        healthLabel      = healthHUD.Find("HealthBar/Label").GetComponent <Text>();
        originalBarScale = healthBar.sizeDelta.x;
        healthLabel.text = "" + (int)health;

        hurtHUD = this.gameObject.AddComponent <HurtHUD>();
        hurtHUD.Setup(healthHUD, hurtPrefab, decayFactor, this.transform);
    }
Exemplo n.º 2
0
    private void Awake()
    {
        animator    = GetComponent <Animator>();
        totalHealth = health;

        healthBar        = healthHUD.Find("HealthBar/Bar").GetComponent <RectTransform>();
        placeHolderBar   = healthHUD.Find("HealthBar/Placeholder").GetComponent <RectTransform>();
        healthLabel      = healthHUD.Find("HealthBar/Label").GetComponent <Text>();
        originalBarScale = healthBar.sizeDelta.x;
        healthLabel.text = string.Format(" {0}", (int)health);

        criticalHUD = healthHUD.Find("Bloodframe").GetComponent <BlinkHUD>();
        hurtHUD     = gameObject.AddComponent <HurtHUD>();
        hurtHUD.Setup(healthHUD, hurtPrefab, decayFactor, transform);
    }