Exemplo n.º 1
0
    public static DialoguePopup Create(Vector3 position, string dialogue)
    {
        Transform     dialoguePopupTransform = Instantiate(Resources.Load <Transform>("pfDialoguePopup"), position, Quaternion.identity);
        DialoguePopup dialoguePopup          = dialoguePopupTransform.GetComponent <DialoguePopup>();

        dialoguePopup.Setup(dialogue);

        dialoguePopup.transform.LookAt(dialoguePopup.transform.position + Camera.main.transform.rotation * Vector3.forward, Camera.main.transform.rotation * Vector3.up);

        return(dialoguePopup);
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit))
            {
                DialoguePopup.Create(hit.point, "Hey, Listen...");
            }
        }
    }
Exemplo n.º 3
0
 public void showDialogPopup(RaycastHit hit)
 {
     DialoguePopup.Create(hit.point, key_Name + "DP");
 }
Exemplo n.º 4
0
 private void Awake()
 {
     S = this;
 }
 void Awake()
 {
     instance = this;
     ClosePopup();
 }