I'm trying to make a randomized generation engine for a top down dungeon crawler, in the Binding of Isaac style, however, the code is throwing out a multitude of errors when I try it compare a value to a value in the list. The errors are on lines 44, 155, 271, and 384 which are all if statements that are all formatted as such:
if(gameMaster.PositionsOfRooms.Contains(generatorPoint.transform.position))
Code Snippet:
public class DoorGenerator : MonoBehaviour
public bool isdoor;
public bool facingUp;
public bool facingDown;
public bool facingRight;
public bool facingLeft;
public bool generated;
public bool startingRoom = false;
public int runningRoomCount;
public GameObject generatorPoint;
public GameMasterScript gameMaster;
public Transform teleportfromCords;
public Transform teleporttoCords;
public GameObject camera;
// Start is called before the first frame update
void Start()
{
gameMaster = GameObject.Find("GameMaster").GetComponent<GameMasterScript>();
teleportfromCords = transform.Find("TeleportPoint");
camera = GameObject.Find("Main Camera");
}
// Update is called once per frame
void Update()
{
if(generated == false && gameMaster.targetRooms > gameMaster.roomsGenerated)
{
GenerateRoom();
}
}
public void GenerateRoom()
{if(generated ==false){
generated = true;
{
if(facingUp == true)
{
generatorPoint = transform.parent.Find("CreateRoomUp").gameObject;
if(gameMaster.PositionsOfRooms.Contains(new Vector3(generatorPoint.transform.position.x, generatorPoint.transform.position.y, generatorPoint.transform.position.z)))
{
return;
}
else
{