public bool HasKeycard(KeycardType keycardType) { //Use tracker bools to return info on whether the user has that keycard if (keycardType == KeycardType.Blue) { return(hasBlueKeycard); } else if (keycardType == KeycardType.Red) { return(hasRedKeycard); } else if (keycardType == KeycardType.Yellow) { return(hasYellowKeycard); } return(false); }
public void AcquireKeycard(KeycardType keycardType) { //Depending on the color of the keycard, set the inventory representation //to active, and set our tracker bool to true if (keycardType == KeycardType.Blue) { keycardBlue.SetActive(true); hasBlueKeycard = true; } else if (keycardType == KeycardType.Red) { keycardRed.SetActive(true); hasRedKeycard = true; } else if (keycardType == KeycardType.Yellow) { keycardYellow.SetActive(true); hasYellowKeycard = true; } }