Example #1
0
 public override void Execute()
 {
     base.Execute();
     //enables the colliders for the small half ramps upon entering and being in the third lane, also works for lane four
     SHRampOne.GetComponent <BoxCollider>().enabled   = true;
     SHRampTwo.GetComponent <BoxCollider>().enabled   = true;
     SHRampThree.GetComponent <BoxCollider>().enabled = true;
     //checks for lane up or down
     if (Input.GetKey(KeyCode.W) && lValues.GetTimePassed() > lValues.GetTimer())
     {
         machine.ChangeState <LaneFour>();
     }
     if (Input.GetKey(KeyCode.S) && lValues.GetTimePassed() > lValues.GetTimer())
     {
         machine.ChangeState <LaneTwo>();
     }
 }
Example #2
0
 public override void Execute()
 {
     base.Execute();
     //disables the small half ramp colliders upon entering this lane as the ramp only takes up the third and fourth lane
     SHRampOne.GetComponent <BoxCollider>().enabled   = false;
     SHRampTwo.GetComponent <BoxCollider>().enabled   = false;
     SHRampThree.GetComponent <BoxCollider>().enabled = false;
     //two different inputs can happen in this lane, checks if you want to increase or decrease which lane you are in
     if (Input.GetKey(KeyCode.W) && lValues.GetTimePassed() > lValues.GetTimer())
     {
         machine.ChangeState <LaneThree>();
     }
     if (Input.GetKey(KeyCode.S) && lValues.GetTimePassed() > lValues.GetTimer())
     {
         machine.ChangeState <LaneOne>();
     }
 }