Skip to content

Commit 29660ba

Browse files
authored
Create HideTrigger.cs
1 parent c274287 commit 29660ba

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

HideTrigger.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
using UnityEngine.UI;
5+
6+
public class HideTrigger : MonoBehaviour
7+
{
8+
public GameObject EnterText;
9+
10+
void OnTriggerEnter(Collider other)
11+
{
12+
EnterText.GetComponent<Text>().text = "Your Text";
13+
}
14+
15+
void OnTriggerExit(Collider other)
16+
{
17+
EnterText.GetComponent<Text>().text = "";
18+
}
19+
20+
21+
}

0 commit comments

Comments
 (0)