void OnTriggerEnter(Collider other) { if (other.gameObject == player && !questEnd) { if (inventory.RemoveItem(bucketInventoryItem)) { questEnd = true; //finalBucket.SetActive(true); //Runterfallenden Bucket erzeugen //Quaternion rot = new Quaternion(); //Drehung des urspruenglichen Modells ausgleichen //rot.eulerAngles = new Vector3(-90,0,0); Instantiate(bucketInventoryItem.prefab, player.transform.position + player.transform.forward + player.transform.up, Quaternion.identity); messageText.text = questEndedMessage; epController.AddPoints(eps); } else { if (gotQuest) { messageText.text = questMessage2; } else { messageText.text = questMessage; } gotQuest = true; } } }
void OnTriggerEnter(Collider other) { if (other.gameObject == player) { if (inventory.RemoveItem(goldenKeyInventoryItem)) { //finalBucket.SetActive(true); //Runterfallenden Bucket erzeugen //Quaternion rot = new Quaternion(); //Drehung des urspruenglichen Modells ausgleichen //rot.eulerAngles = new Vector3(-90,0,0); messageText3.text = questEndedMessage; epController.AddPoints(eps); endedQuest = true; } else { if (endedQuest) { messageText3.text = ""; } if (gotQuest && !endedQuest) { messageText3.text = questMessage2; } if (!gotQuest && !endedQuest) { messageText3.text = questMessage; } gotQuest = true; } } }
void DestroyMe() { Destroy(gameObject); epController.AddPoints(eps); }