Exemple #1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("item") && item != null && item.isPick == false)
        {
            item.outlinerItem.enabled = false;
            item.interactionIcon.SetActive(false);
            item = null;
        }

        //pot
        if (other.CompareTag("pot") && potActuel != null)
        {
            potActuel.outlinerItem.enabled = false;
            potActuel.interactionIcon.SetActive(false);
            potActuel.interactionIcon2.SetActive(false);
            potActuel = null;
        }

        //panneau
        if (other.CompareTag("panneau") && panneau != null)
        {
            panneau.outlinerItem.enabled = false;
            panneau.interactionIcon.SetActive(false);

            panneau = null;
        }

        //dialogue
        if (other.CompareTag("dialogue") && dialogueActuel != null)
        {
            //if (managerDialogue.dialogueActive == false)
            //{
            dialogueActuel.DesactiveOutline();

            isTalk = false;

            dialogueActuel.camDialogue.Priority = 0;
            dialogueActuel.camDialogue.enabled  = false;

            //dialogueActuel.UpgradeQuest();
            //dialogueActuel.UpgradeAnimalTalk();

            //dialogueActuel.StopDialogue();
            dialogueActuel.enabled = false;

            dialogueActuel = null;

            managerDialogue.dialogueActive = false;
            //}
        }

        //banc

        if (other.CompareTag("banc") && bancActuel != null)
        {
            bancActuel.DesactiveOutline();
            bancActuel.enabled = false;

            bancActuel = null;
        }
    }
Exemple #2
0
    private void OnTriggerStay(Collider other)
    {
        if (other.CompareTag("item"))//outline
        {
            type = PlayerMovement.interactionType.item;

            if (item == null)
            {
                item = other.gameObject.GetComponent <itemPick>();
            }

            if (item.isPick == false)
            {
                item.outlinerItem.enabled = true;
                item.interactionIcon.SetActive(true);
            }
            else
            {
                item.outlinerItem.enabled = false;
                item.interactionIcon.SetActive(false);
            }
        }

        //pot
        if (other.CompareTag("pot"))//outline
        {
            type = PlayerMovement.interactionType.pot;

            if (potActuel == null)
            {
                potActuel = other.gameObject.GetComponent <pot>();
            }

            if (potActuel.fleurDePot.activeInHierarchy == false)
            {
                potActuel.outlinerItem.enabled = true;
                potActuel.interactionIcon.SetActive(true);
                potActuel.interactionIcon2.SetActive(true);
            }
        }

        //panneau
        if (other.CompareTag("panneau"))//outline
        {
            type = PlayerMovement.interactionType.panneau;

            if (panneau == null)
            {
                panneau = other.gameObject.GetComponent <cartePanneau>();
            }


            panneau.outlinerItem.enabled = true;
            panneau.interactionIcon.SetActive(true);
        }

        //dialogue
        if (other.CompareTag("dialogue"))
        {
            type = PlayerMovement.interactionType.dialogue;

            if (managerDialogue.dialogueActive == false)
            {
                dialogueActuel = null;

                if (dialogueActuel == null)
                {
                    dialogueActuel = other.GetComponent <Dialogue_Trigger>();
                }

                dialogueActuel.enabled = true;
                dialogueActuel.ActiveOutline();
            }
        }


        //banc

        if (other.CompareTag("banc"))
        {
            type = PlayerMovement.interactionType.banc;

            bancActuel = other.GetComponent <banc>();

            bancActuel.enabled = true;

            if (bancActuel.isBanc == false)
            {
                bancActuel.ActiveOutline();
            }
        }
    }