private void Start()
 {
     bc        = gameObject.GetComponent <BoxCollider2D>();
     DMscript  = DManager.GetComponent <DialogeManager>();
     canTalk   = false;
     isTalking = false;
 }
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.name == "Player")
        {
            dialogueWasTriggered = true;
            FindObjectOfType <PauseMenu>().canPause = false;
            if (Enemy.transform.GetComponent <Enemy>() != null)
            {
                Enemy.GetComponent <Pathfinding.AIPath>().canMove = false;
            }
            if (Ramsey.transform.GetComponent <PlayerMovement>() != null)
            {
                //collider.transform.parent.GetComponent<PlayerMovement>().canMove = false;

                Ramsey.transform.GetComponent <PlayerMovement>().canMove = false;
                Ramsey.GetComponent <Animator>().Play("Idle");
            }
            //FindObjectOfType<DialogeManager>().StartDialogue(dialogue);
            manager = new DialogeManager();
            manager.StartDialogue(dialogue);
            dialogueImage.sprite = dialogueImageToBe;
            dialogueImage.rectTransform.sizeDelta = new Vector2(800, 100);
            dialogueImage.color = new Color(255, 255, 255, 1);

            textBox.text = dialogue.sentences[currentSentence];

            Debug.Log("");
            Destroy(dialogueCollider);
        }
    }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     dm = GameObject.Find("Dialoge").GetComponent <DialogeManager> ();
 }
Exemple #4
0
 void Start()
 {
     dm = FindObjectOfType <DialogeManager>();
     Invoke("setUpPanels", 2);
 }