Esempio n. 1
0
    IEnumerator Start()
    {
        health        = GetComponent <Health2D>();
        health.Invuln = true;

        yield return(new WaitForSeconds(SPAWN_INVULN_TIME));

        health.Invuln = false;
    }
Esempio n. 2
0
    void Awake()
    {
        SingletonSetInstance(this, true);

        health = GetComponent <Health2D>();
        health.HealthChanged.AddListener(onDamage);

        lastFramePosition = transform.position;
        facingDir         = Vector2.up;

        CurrentLives = MaxLives;
    }