May 2018
Beginner
492 pages
11h 53m
English
Now the BalloonController can access the input data object rather than MeMyselfEye. Otherwise is very similar and a simple refactor. Modify BalloonController.cs as follows.
First, we can remove any references to MeMyselfEye in the BalloonController, including the public variable and the entire Start() function (we do not need the GetComponent<MyInputController>).
Add a variable for the input data object:
public MyInputAction myInput;
And reference it in the Update conditions:
void Update(){ if (myInput.buttonAction == MyInputAction.ButtonAction.PressedDown) { NewBalloon(); } else if (myInput.buttonAction == MyInputAction.ButtonAction.ReleasedUp) { ReleaseBalloon(); } else if (balloon != null) { GrowBalloon(); ...Read now
Unlock full access