Before i updated this morning it was working as intended, but i want to display an image in the upper left of the screen. Basic image letting the player know FLash light Off(Gray Out) and Flashlight Active(Full colored).
I created the images already, but i cannot seem to get it to let me add them, i am used to the java now so if anyone can point out what i “Fubar’ed” i would appreciate it.
Error: CS0117:
UnityEngine.GUI' does not contain a definition forTexture’
I forgot to note: It’s on Lines, 45,48,49
Here is the code, i tried several variations, like toggle it On/Off, and jusr turn one of and the other off…
using UnityEngine;
using System.Collections;
public class FlashLight : MonoBehaviour
{
public Texture2D image;
public Texture2D image2;
public Light FlashLightObject;
private bool LightEnabled = false;
private bool ShowHide = true;
private bool ShowHide2 = false;
void Update ()
{
if(Input.GetButtonDown("Flashlight"))
{
LightEnabled = !LightEnabled;
FlashLightObject.enabled = LightEnabled;
ShowHide = GUI.Texture (new Rect (10,10,image.width,image.height),image);
//ShowHide.SetActiveRecursively(!ShowHide.active);
audio.Play();
if(!LightEnabled = false){
ShowHide2 = GUI.Texture (new Rect (10,10,image2.width,image2.height),image2);
//ShowHide2.SetActiveRecursively(!ShowHide2.active);
}
}
}
}