public void Click() { switch (actionData.actionType) { case ActionData.ActionType.DIALOGUE: dialogueObject.SelectDialogue(actionData.dialogueData); return; case ActionData.ActionType.ACTIVE: if (actionData.nextDialogue != null) { dialogueObject.SelectDialogue(actionData.nextDialogue); } else { dialogueObject.EndDialogue(); } break; case ActionData.ActionType.PASSCODE: CheckPasscode(); Destroy(curPasscodeInput); return; case ActionData.ActionType.DIE: GameObject player = GameObject.FindGameObjectWithTag("Player"); player.GetComponent <PlayerHealth>().Die(); return; } dialogueObject.DoAction(actionData); }