How do i do a square waveform ?,How do i do a square waveform with a sample range of -1 from 1?

,I have the sin wave working like this return Mathf.Sin(currentPhase * 2 * Mathf.PI);
and i want to add a squre waveform but i cant figure it out can someone help me?

If you already got your sine wave working you can generate a sqaure wave as follows :

private int SqaureWave (float currentphase )
{
          return Mathf.Sign ( Mathf.Sin(currentphase * 2 * Math.PI));
}