Skip to content
Snippets Groups Projects
Commit 24745889 authored by Robin Ruud Kristensen's avatar Robin Ruud Kristensen
Browse files

check for room and enemies

parent 3f80e6f4
No related branches found
No related tags found
2 merge requests!75Main,!66Ruud1
......@@ -11,14 +11,15 @@ namespace BigSock.Interact {
public Sprite newSprite;
private GameObject[] enemies;
private GameObject player;
private GameObject cameraPlayer;
private int i = TilemapGenerator.NextRoom();
private GameObject boundary;
private GameObject cameraPlayer;
private int i = TilemapGenerator.NextRoom();
private GameObject boundary;
public string InteractionPrompt => _prompt;
public string InteractionPrompt => _prompt;
public bool Interact(Interactor interactor) {
enemies = GameObject.FindGameObjectsWithTag((i - 1).ToString());
public bool Interact(Interactor interactor) {
if(i > 0)enemies = GameObject.FindGameObjectsWithTag((i - 1).ToString());
else if (i > 0) enemies = GameObject.FindGameObjectsWithTag((0).ToString());
if (enemies.Length == 0)
{
Debug.Log("Opening door!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment