protected virtual void Awake() { material = GetComponent <SpriteRenderer>().material; materialTintColor = new Color(1f, 0f, 0f, 150f / 255f); healthBarFade = GetComponentInChildren <HealthBarFade>(); }
private void Awake() { animator = GetComponent <Animator>(); rigidbody2D = GetComponent <Rigidbody2D>(); healthBarFade = GetComponentInChildren <HealthBarFade>(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } barImage = transform.Find("bar").GetComponent <Image>(); damagedBarImage = transform.Find("damagedBar").GetComponent <Image>(); damagedColor = damagedBarImage.color; damagedColor.a = 0f; damagedBarImage.color = damagedColor; }