void OnTriggerEnter(Collider col) { if (col.tag == "killable") { text.text = "Press E to kill"; currentCollider = col; toDoAction = possibleActions.kill; } else if (col.tag == "takeable") { text.text = "Press E to take " + col.gameObject.name; currentCollider = col; toDoAction = possibleActions.take; } else if (col.tag == "openable") { text.text = "Press E to open the door"; currentCollider = col; toDoAction = possibleActions.open; } }
void AfterAction() { text.text = ""; currentCollider = null; toDoAction = possibleActions.nothing; }
public Actions(possibleActions setOfActions, string text) { this.text = text; this.setOfActions = setOfActions; }