Beispiel #1
0
    public void GetDamagedBy(Color c, float damage)
    {
        float value;

        value      = ColorableEntity.ColorCompare(this.color, c) * damage;
        this.life -= value;
    }
Beispiel #2
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        ColorableEntity ent = collision.GetComponentInChildren <ColorableEntity>();

        if (collision.gameObject.CompareTag("Player") && Input.GetKeyDown("f"))
        {
            onLeverOn.Invoke();
            lev.Play("LeverOn");
        }
        else if (ent != null && ColorableEntity.ColorCompare(ent.color, this.color) > threshold)
        {
            onLeverOn.Invoke();
            lev.Play("LeverOn");
        }
    }
Beispiel #3
0
    public void GetDamagedBy(Color c, float damage)
    {
        float value;

        value = ColorableEntity.ColorCompare(this.color, c) * damage;

        this.boss.life -= value;

        if (this.boss.life <= 0f)
        {
            this.myCollider.enabled = false;
        }

        HUDManager.instance.UpdateBossHealthBar(this.boss, this.boss.life);

        this.StartAndStopCoroutine(ref this.shakeCoroutine, this.DamageCoroutine());
    }