Exemple #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.isTrigger)
        {
            return;
        }
        DialogueSystem d = collision.GetComponentInParent <DialogueSystem>();

        if (d != null)
        {
            foreach (var i in itemsToQueue)
            {
                d.Enqueue(i);
            }
            var c = d.GetComponent <CarController>();
            if (doBrake)
            {
                c.isRunning = false;
                d.Enqueue(new DialogueSystem.DialogueItem("", "", 0.001f, d.OnStart));
            }
            if (oneShot)
            {
                gameObject.SetActive(false);
            }
        }
    }
 public void CreateDialogBox(Vector3 position)
 {
     dialogBoxSystem = Instantiate(dialogBoxPrefab, transform).GetComponent <DialogueSystem>();
     dialogBoxSystem.GetComponent <RectTransform>().anchoredPosition = position;
 }