private void OnTriggerExit(Collider other) { if (other.gameObject.tag.Equals("Monster")) { MonsterXboxController monster = other.gameObject.GetComponent <MonsterXboxController>(); if (monster != null) { string removeInteract = monster.GetInteractButton(); int index = int.Parse(removeInteract.Substring(removeInteract.Length - 1)) - 1; interacts[index] = ""; monsters[index] = null; } } }
private void OnTriggerEnter(Collider other) { if (!totem.StillSpawning() && totem.curEnemy == null && other.gameObject.tag.Equals("Monster")) { MonsterXboxController monster = other.gameObject.GetComponent <MonsterXboxController>(); if (monster != null) { string newInteract = monster.GetInteractButton(); int index = int.Parse(newInteract.Substring(newInteract.Length - 1)) - 1; interacts[index] = newInteract; monsters[index] = monster; } } }