Exemplo n.º 1
0
    public void Heal(float amount)
    {
        this.Health = this.Health + amount;

        state = TurretStateManager.GetState(health);

        if (objSprite == null)
        {
            return;
        }

        objSprite.color = TurretStateManager.GetStateColor(state);
    }
    public void TakeDamage(float amount)
    {
        Debug.Log("MinigunController:TakeDamage() - amount = " + amount);

        health -= amount;

        health = Mathf.Clamp(health, 0.0f, maxHealth);

        state = TurretStateManager.GetState(health);

        if (objSprite == null)
        {
            return;
        }

        UpdateSprite();
    }
Exemplo n.º 3
0
    public void TakeDamage(float amount)
    {
        //Debug.Log("TurretBarrelController:TakeDamage() - amount = " + amount);

        health -= amount;

        health = Mathf.Clamp(health, 0.0f, maxHealth);

        state = TurretStateManager.GetState(health);

        if (objSprite == null)
        {
            return;
        }

        objSprite.color = TurretStateManager.GetStateColor(state);

        GameInfoManager.Instance.IncrementDamageReceived(amount);
    }