コード例 #1
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();
            }
        }
    }