Пример #1
0
    protected virtual void Awake()
    {
        material          = GetComponent <SpriteRenderer>().material;
        materialTintColor = new Color(1f, 0f, 0f, 150f / 255f);

        healthBarFade = GetComponentInChildren <HealthBarFade>();
    }
Пример #2
0
    private void Awake()
    {
        animator    = GetComponent <Animator>();
        rigidbody2D = GetComponent <Rigidbody2D>();

        healthBarFade = GetComponentInChildren <HealthBarFade>();
    }
Пример #3
0
    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;
    }