Search Unity

Sudden errors for GUI.DrawTexture

Discussion in 'Immediate Mode GUI (IMGUI)' started by Rad-Coders, May 29, 2016.

  1. Rad-Coders

    Rad-Coders

    Joined:
    Apr 10, 2015
    Posts:
    36
    Hi, this morning I suddenly got errors when trying to compile scripts. Everything was working the previous day.

    I'm using Unity 5.2.4. So when I try to compile for instance something like this I get "Best overload method match for 'UnityEngine.GUI.DrawTexture(UnityEnginge.Rect, UnityEngine.Texture) ' has some invalid arguments" and "Argument 2 cannot convert 'Texture' expression to type 'UnityEngine.Texture'"


    Code (CSharp):
    1. using UnityEngine;
    2.   using UnityEngine.Collections;
    3.  
    4.   public class MainUI : MonoBehaviour
    5.   {
    6.   public Texture sampleTex;
    7.  
    8.   void OnGUI ()
    9.   {
    10.   GUI.DrawTexture(new Rect(0, 0, 100, 100), sampleTex);
    11.   }
    12.   }
    This happened to all of my scripts and got 344 of these errors in total. But why all of the sudden when it work yesterday. Any help will be greatly appreciated.

    Thanks
    --Andre
     
  2. Rad-Coders

    Rad-Coders

    Joined:
    Apr 10, 2015
    Posts:
    36
    False alarm everyone, I just had a class named Texture.
     
    IzzySoft likes this.