void OnTriggerEnter(Collider other) { if (other.tag == "Player" && trigger == TriggerType.SimpleTrigger && CheckTokens()) { ConversationController.Enable(this); } }
void OnTriggerStay(Collider other) { if (other.tag == "Player" && trigger == TriggerType.ButtonTrigger && Input.GetKey(keyRequired) && CheckTokens()) { ConversationController.Enable(this); } }
void Start() { GetComponentInChildren <Text>().text = choiceText; GetComponent <Button>().onClick.AddListener(() => // Adds an event to the button { ConversationController.Enable(choicePointer); ConversationTrigger.AddToken(choiceToken); }); }
void FixedUpdate() { if (trigger == TriggerType.Instant || trigger == TriggerType.HardInstant) { timer += Time.deltaTime; if (timer > 0.25f && CheckTokens() && (!ConversationController.currentlyEnabled || trigger == TriggerType.HardInstant)) { timer = 0f; //Debug.Log("Token already exists in dict: " + conversationName); if (trigger == TriggerType.HardInstant) { tokens.Add("HardInstant_" + conversationName); } ConversationController.Enable(this); } else if (timer > 0.5f) { timer = 0f; } } }