Syntax looks correct, but void states aren't highlighted? (CS1519, CS1525, CS1026)

So here is an example from my game. I have a long list of states, and some get ‘highlighted’ (changed to a blue color and therefore ‘active’) but some do not. Each of them have the same format (I copied and pasted to make sure) and sometimes the color will change if I simply press the SPACE or BACKSPACE button a number of times.

For example, what I copied here comes from the game. Here, void listen_1() { comes out as yellow, highlighted, so to speak. In my actual Monodevelop code, they do not.

Doesn’t seem very…precise. :smiley:

I’m new to coding, so any help is appreciated! Also not sure if my list of enum states is needed?

Thanks in advance!

[Use Monodevelop and Unity 4.6.9]

void smell_0() {

	            text.text =	"It smelled of earth that had not been lived in by root or water " +
	                        "in a long, long time. The air itself was dead. Jennet thought she smelled " +
	                        "something familiar, something faraway. \n\n " 
	                        "Rosemary. \n\n "
			                "~One must use their other senses. Press L to listen, E to examine, or S to smell~. " ;
                       if (Input.GetKeyDown(KeyCode.E)) {myState = States.examine_1;}
                  else if (Input.GetKeyDown(KeyCode.L)) (myState = States.listen_1;} 
	              else if (Input.GetKeyDown(KeyCode.S)) (myState = States.smell_1;} 
 }
 
	    void listen_1 () {
               text.text = "Her granny had taught her to listen, to listen, to listen. " +
                           "She sat in silence, first listening to her heartbeat, then to something outside it. \n\n " 
                           "An intake of breath. Not her own. She looked at the shadows on the other side of the hollow and somewhere inside it a dusty breath went in and out. \n\n "
                           "~Press ! to scream. Press ? to ask a question~." ;
                        if (Input.GetKeyDown(KeyCode.!)) (myState = States.scream;}
                   else if (Input.GetKeyDown(KeyCode.?)) (myState = States.listen_question;} 
  }

Privacy & Terms