Exemple #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && trigger == TriggerType.SimpleTrigger && CheckTokens())
     {
         ConversationController.Enable(this);
     }
 }
Exemple #2
0
 void OnTriggerStay(Collider other)
 {
     if (other.tag == "Player" && trigger == TriggerType.ButtonTrigger && Input.GetKey(keyRequired) && CheckTokens())
     {
         ConversationController.Enable(this);
     }
 }
Exemple #3
0
 void Start()
 {
     GetComponentInChildren <Text>().text = choiceText;
     GetComponent <Button>().onClick.AddListener(() =>           // Adds an event to the button
     {
         ConversationController.Enable(choicePointer);
         ConversationTrigger.AddToken(choiceToken);
     });
 }
Exemple #4
0
    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;
            }
        }
    }