Cant Get Simple Boolean Statement to Work!

Hey guys, I am trying to make a simple boolean statement work and am having trouble. What I am trying to do is make my text based game (based on the Prisoner game from Udemy course) allow my character to “acquire” an item. What I want to happen is that when the character observes the mirror they can take a mirror shard, I want this to be a true/false statement in the game. This will allow me to then check “has player taken this item?” and if so it will ensure that the player re-enters their cell in a state where they have taken the item. I want the character to be able to acquire different items in the game and “check” for their existence later. This will also allow me to add status effects I think but I cant get it to work! Here is what I have so far…

using UnityEngine;

using UnityEngine.UI;

using System.Collections;

public class TextController : MonoBehaviour {

public bool takeMirror = false;

// Then down below I have:

void mirror_0 () 

        text.text = "You look at the cracked mirror and realize a piece has broken off... " +
                    "You examine the mirror thinking 'The last time I held a mirror it was 1988 " +
                    "at a disco, too bad there are no hookers or cocaine here! " +
                    "I guess if I fail to escape Ill still have a way 'out' though!

" +

                    "Press T to take the mirror shard. Press R to return to roaming your cell.";
        if         (Input.GetKeyDown(KeyCode.R))        {myState = States.cell;}
        else if (Input.GetKeyDown(KeyCode.T))

            {
                myState = States.cell_mirror;
                takeMirror = !takeMirror;
            }

    }

Im not sure if this is working or not. The intention is that later the game can check if you still have the mirror and can then use it to give the player more options. Im also planning on status effects so that a person can choose a dark path of attempting suicide out of desperation but then wrapping their wrists (after the attempt because they panic and change their minds) but it will add weakness to their character by checking if “suicide = true or false”. Later the game will check if weakness = true and if so they wont be able to move certain heavy objects they encounter.

Im really new to coding and cant seem to find a good boolean tutorial online that explains what Im trying to do clearly.

Woo hoo! I am finally getting the code to work!

Heres what I did:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class TextController : MonoBehaviour {

	public Text text;
	private enum States {cell, exam_cell, take_sheets};
	private States myState;
	
	
	public bool takeMirror = false;
	public bool takeSheets = false;
	public bool playerWeakness = false;

Then down below I have:

void exam_cell () {

	if 	(takeSheets == true) {

		text.text = "Sheets in hand you look around your cell. How might I apply these to escape?

";}

	else if (takeSheets == false) {
	
		text.text = "Looking around you are filled with dread and hopelessness. The rusty cell door is locked and " +
					"looking beyond the bars of the door you notice a long and dark hallway full of broken " +
					"furniture and water puddles, the place gives off a musty and dank aroma.

" +

					"There are no windows but you notice a hole in the celing for air circulation " +
					"with a bar going across the opening. Too small to fit through though! " +
					"... thats what she said!

" +

					"Press S to view sheets, M to view mirror, D to view door.";}
				
	if 		(Input.GetKeyDown(KeyCode.S))		{myState = States.sheets;}
	
}

void take_sheets () {
	
	text.text = "You examine the sheets, although they may be better referred to as " +
				"musty, mouldy, dilapidated rags! " +
				"Still, I wonder what I could do with these...

" +

				"Press T to take the sheets and return to examining your cell.";
				
	if 		(Input.GetKeyDown(KeyCode.T))
	
	{
	
	takeSheets = true;
	myState = States.exam_cell;
	
	}
	
}

}

What Ive done is taken the state “exam_cell” and defined the conditions within it regarding what to display, instead of creating a separate state for every condition. Thus if the sheet has been taken the game will display one message, if the mirror only has been taken it will display the mirror message.

Now I just need to figure out how to get it to check if both takeMirror and takeSheet = true to display a text that is relevant to having both items.