public clues itemClue(int num) { clues tempClue = new clues(); switch (num) { case 1: tempClue.setClue("a convenient plot device", 1); break; case 2: tempClue.setClue("the murder weapon", 2); break; default: tempClue.setClue("nothing", 0); break; } return(tempClue); }
public void generateClues() { for (int i = 0; i < numbersOfClues; i++) { listOfClues[i] = new clues(); int n = i + 1; string newClueName = cluesNames + n.ToString(); listOfClues[i].setClueName(newClueName); listOfClues[i].setClueId(i); listOfClues[i].setClueHuntId(0); listOfClues[i].setClueRiddle(cluesRiddle[i]); listOfClues[i].setObjectToShow(rewards[i]); listOfClues[i].setClueCoordinates(cluesCoordinates[i]); listOfClues[i].setClueHint(clueHints[i]); } for (int i = 0; i < numbersOfClues; i++) { if (listOfClues[i].getClueHuntId() == fk_hunt_id) { int clueId = listOfClues[i].getClueId(); GameObject newPlaceHolder = Instantiate(placeHolder, currentPage.transform); Vector3 newPosition = newPlaceHolder.transform.position; newPosition.y = newPosition.y - (margin * i); newPlaceHolder.transform.position = newPosition; nameholders = newPlaceHolder.transform.GetChild(0).gameObject; listOfClues[i].getClueName(nameholders); nameholders.GetComponent <Button>().onClick.AddListener(delegate { headToARPage(clueId); }); buttons[i] = newPlaceHolder; imageHolder = newPlaceHolder.transform.GetChild(1); } else { Debug.Log("no id was picked"); } } }