Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

What am I doing wrong? C#

$
0
0
using UnityEngine; using System.Collections; public class MainGUI : MonoBehaviour { public GUITexture redKey; public GUITexture greenKey; public GUITexture pinkKey; public GUITexture yellowKey; public GUITexture purpleKey; public GUITexture orangeKey; public Vector2 redCoord; public Vector2 greenCoord; public Vector2 pinkCoord; public Vector2 yellowCoord; public Vector2 purpleCoord; public Vector2 orangeCoord; //other script with bool seing if you have a key public doors d; // Use this for initialization void Start () { redKey.enabled = true; greenKey.enabled = false; pinkKey.enabled = false; yellowKey.enabled = false; purpleKey.enabled = false; orangeKey.enabled = false; } // Update is called once per frame void Update () { if (d.aredKey == true){ redKey.enabled = true; } if (d.agreenKey == true){ greenKey.enabled = true; } if (d.apinkKey == true){ pinkKey.enabled = true; } if (d.apinkKey == true){ pinkKey.enabled = true; } if (d.ayellowKey == true){ yellowKey.enabled = true; } if (d.apurpleKey == true){ purpleKey.enabled = true; } if (d.aorangeKey == true){ orangeKey.enabled = true; } } } Im trying to get my GUITexture to display when I hit a key but nothing is happening

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>