Exemple #1
0
    // initializes strafing movement
    private void StartStrafing()
    {
        strafeDurationSet = Random.Range(strafeDurationMin, strafeDurationMax);
        float rand = Random.Range(0f, 1f);

        if (rand > 0.5f)
        {
            sidewaysStrafeDir = StrafeSidewaysDirection.Left;
        }
        else
        {
            sidewaysStrafeDir = StrafeSidewaysDirection.Right;
        }
    }
Exemple #2
0
 // change from strafing left or right
 private void SwitchStrafeDirection()
 {
     sidewaysStrafeDir = (sidewaysStrafeDir == StrafeSidewaysDirection.Left) ? StrafeSidewaysDirection.Right : StrafeSidewaysDirection.Left;
     strafeDurationSet = Random.Range(strafeDurationMin, strafeDurationMax);
 }