The switch didn’t seem to be performing any tests, and I didn’t actually seem to be getting any input from the Input.inputString command. While the code compiled, still same issue. After displaying my prompt, I then attempted to set my string variable to the method. I then attempted to create a string variable called choice. Tried that in the game, and it did not take me anywhere. So, I went and reviewed the Input.inputString, and it looks like it is supposed to exit out of the method after an enter key. It was like it wasn’t actually taking in any input. Success! I could compile my code! But, once the game was running, no matter what input I entered into the game, it never changed off of the first screen. I then tried changing tactics, and instead of using Input.GetKeyDown, I tried using Input.inputString. Same issue, can’t convert the method type. I then tried it like so, where instead of doing the case on the Ke圜ode, I just tried the key. I first tried it using in the following format to no avail, as method group could not be converted to a int, char, or string. ![]() The Input.GetKeyDown command is a Boolean value, so what it returns is a yes or no based on what you tell it to test for. Here is everything I went thru trying to turn the individual functions for the rooms into switch statements instead of if else statements. ![]() So instead of if (myState = States.cell) you could use a switch statement. A switch statement should in theory work for the Update function. I don’t think it’s possible, at least at this stage of the course. So, I spent about 4 hours today hammering to try and figure out the Switch command and never came up with anything.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |