Videogames Development – Unity – If Statements (dichiarazioni If)

IF – ELSE

if (1 == a)
{
             // Do a set of actions
}
else
{
             // Do another set of actions
}

IF – ELSE IF

if (1 == a)
{
             // Do a set of actions
}
else if (2 -- b)
{
             // Do another set of actions
}
else
{
             // Do YET another set of actions
}

IF – NESTED (annidato)

if (1 == a)
 {
     if (2 ==b)
      {
             // Do a set of actions
      }
}