示例#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);
    }
示例#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);
    }
示例#3
0
 private void Awake()
 {
     AudioListener.pause = false;
     hurtUI = this.gameObject.AddComponent <HurtHUD>();
     hurtUI.Setup(canvas, hurtPrefab, decayFactor, this.transform);
 }