コード例 #1
0
 void OnTriggerEnter2D(Collider2D o)
 {
     if (o.tag == "Player")
     {
         NotificationObject.ChangeText(text);
     }
 }
コード例 #2
0
 void OnTriggerExit2D(Collider2D o)
 {
     if (o.tag == "Player" && NotificationObject.currentText == text)
     {
         NotificationObject.ChangeText("");
     }
 }
コード例 #3
0
 public void OnTriggerEnter2D(Collider2D c)
 {
     if (c.tag == "Player")
     {
         entered = true;
         NotificationObject.ChangeText(text);
     }
 }
コード例 #4
0
    void Update()
    {
        if (Vector2.Distance(transform.position, player.position) < maxDistance)
        {
            NotificationObject.ChangeText(notificationText, 0);

            if (Input.GetKeyDown(KeyCode.E))
            {
                d.StartDialouge(dialogName);
                NotificationObject.Close();
            }
        }
        else
        {
            if (NotificationObject.currentText == notificationText)
            {
                NotificationObject.Close();
            }
        }
    }