# Remove nested if statements

I have been learning a new method of programming. I have been programming many years and am recently finding out there is a better method in general via abstract classes.

My question is how to convert a small section of my code so i can understand how this works entirely. So far i could only figure out how to do 1 part:

public abstract class Water
{
}

{
public double TotalWater;

{
if (TotalWater > 999999)
else
}
}


and use it with:

TotalWater.text = AddTotalWater.GetString(amountToAdd);


I would just like some guidance to learn how to do this fully. Is this the proper way to do this to begin with?

This is the nested nightmare I have currently that i want to convert:

public void DetermineWaterValues()
{
if (Time.deltaTime < TotalWaterProductionTime)
{
double tempWaterTime = waterCounter += Time.deltaTime;
if (tempWaterTime > TotalWaterProductionTime)
{
tempWaterTime = TotalWaterProductionTime;
waterCounter = 0;
WaterProgressBar.fillAmount = 0;
}
else
{
if (TotalWaterProductionTime >= 0.1)
WaterProgressBar.fillAmount = (float)(tempWaterTime / TotalWaterProductionTime);
else
WaterProgressBar.fillAmount = 1;
}
}
else
{
WaterProgressBar.fillAmount = 1;