void Start() { dialogueTrigger = GetComponent <Dialogue_Trigger>(); myChattyBubble = Instantiate(chattyBubble, null, false); BoxCollider2D boxCollider = GetComponent <BoxCollider2D>(); if (boxCollider != null) { chattyBubblePosition = boxCollider.size; } else { CircleCollider2D circleCollider = GetComponent <CircleCollider2D>(); if (circleCollider != null) { chattyBubblePosition = new Vector3(circleCollider.bounds.size.x, circleCollider.bounds.size.y); } } myChattyBubble.transform.position = transform.position + chattyBubblePosition; animator = GetComponent <Animator>(); }
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; } }
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(); } } }