Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

Commit

Permalink
Now can press up and down to switch modes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Feb 26, 2018
1 parent fe3fca6 commit 7daca4d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions Assets/Scripts/CoasterSpawning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void Update () {

GameController gameController = GameController.instance;

//print(Input.GetAxis("RightTrigger") + " " + Input.GetAxis("LeftTrigger")); ,
print(gameController.rightController.GetAxis().y);

if (currentMode == 0) {

Expand All @@ -73,14 +73,21 @@ void Update () {
lastspawned = false;
}

if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().x > 0) {
currentCoaster++;
if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().y > 0.5) {
//change mode
currentMode = 1;
modeText.GetComponent<TextMesh>().text = "Move Mode";
modeText.GetComponent<Animator>().SetTrigger("fade");

} else if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().y < -0.5) {
//change mode
currentMode = 1;
modeText.GetComponent<TextMesh>().text = "Move Mode";
modeText.GetComponent<Animator>().SetTrigger("fade");

} else if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().x > 0) {
currentCoaster++;

if (currentCoaster >= options.Length) {
currentCoaster = 0;
}
Expand Down Expand Up @@ -125,15 +132,23 @@ void Update () {
attachedObjects.RemoveAt(0);
}

if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().x < 0) {
if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().y > 0.5) {

//change mode
currentMode = 0;

modeText.GetComponent<TextMesh>().text = "Place Mode";
modeText.GetComponent<Animator>().SetTrigger("fade");
}

} else if (Input.GetButtonDown("RightTrackpadClick") && gameController.rightController.GetAxis().y < -0.5) {

//change mode
currentMode = 0;

modeText.GetComponent<TextMesh>().text = "Place Mode";
modeText.GetComponent<Animator>().SetTrigger("fade");

}
}


Expand Down

0 comments on commit 7daca4d

Please sign in to comment.