Ejemplo n.º 1
0
    public void TakeDamage(float dmgValue)
    {
        if (health > 0.0f)
        {
            health -= dmgValue;

            // Change State
            if (health <= 0.0f)
            {
                buildingDamage = BuildingDamage.destroyed;
            }
            else if (health <= 0.25f)
            {
                buildingDamage = BuildingDamage.stage3;
            }
            else if (health <= 0.50f)
            {
                buildingDamage = BuildingDamage.stage2;
            }
            else if (health <= 0.75f)
            {
                buildingDamage = BuildingDamage.stage1;
            }
        }
    }
Ejemplo n.º 2
0
	public void TakeDamage( float dmgValue )
	{
		if( health > 0.0f)
		{
			health -= dmgValue;
			
			// Change State
			if( health <= 0.0f)
			{
				buildingDamage = BuildingDamage.destroyed;
			}
			else if (health <= 0.25f)
			{
				buildingDamage = BuildingDamage.stage3;
			}
			else if (health <= 0.50f)
			{
				buildingDamage = BuildingDamage.stage2;
			}
			else if (health <= 0.75f)
			{
				buildingDamage = BuildingDamage.stage1;
			}
		}
	}