- Home /
Question by
jack1212-12 · Oct 03, 2016 at 05:59 AM ·
texturebuttondisplay
,GetButtionDown show Texture on screen HELP
,so i want when you press Ctrl it displays a texture than when you press it again it will go away
This is what i have but it does not work im trying to put those together (I'm still a beginner)
public class Texture_Script : MonoBehaviour{
if (Input.GetButtonDown("Fire1"))
public Texture aTexture;
void OnGUI() {
if (!aTexture) {
Debug.LogError("Assign a Texture in the inspector.");
return;
}
GUI.DrawTexture(new Rect(10, 10, 60, 60), aTexture, ScaleMode.ScaleToFit, true, 10.0F);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612093855im_/https://answers.unity.com/themes/thub/images/avi.jpg)