Ejemplo n.º 1
0
    public void TakeDamage(float damage)
    {
        link.SetDamage(damage);
        var t_material = HealthMaterials.GetMaterial(link.health);

        if (material != t_material)
        {
            material = t_material;
            for (int i = 0; i < 0; i++)
            {
                self[i].material = material;
            }
        }
    }
Ejemplo n.º 2
0
    void DamageHull(float damage)
    {
        health -= damage;
        if (health < 0)
        {
            health = 0;
        }

        shipDriver.OnDamaged(damage);

        var t_material = HealthMaterials.GetMaterial(health / maxHealth);

        if (material != t_material)
        {
            material = t_material;
            GetComponent <Renderer>().material = material;
        }
    }