onclick - using c# in unity3D to open a window once the user clicked on a specific object -
i want write code in unity3d using c# whenever user clicked on object inside game window appears contain brief information (that retrieved database) object? can please me? i'm beginner =(
here go, add script gameobject click
using unityengine; using system.collections; public class onclick : monobehaviour { // use initialization private bool popup; public string info; void onmousedown() { popup = true; } void drawinfo() { rect rect = new rect (20,20, 300, 200); rect close = new rect (300,20,20,20); if (popup) { gui.box(rect, info); if (gui.button(close,"x")) { popup = false; } } } void ongui() { drawinfo(); } }
this code should start.
Comments
Post a Comment