The following script will not load in unity, giving out this error:
BCE0023: No appropriate version of 'UnityEngine.GUILayout.Label' for the argument list '(UnityEngine.TextAsset)' was found.
Here’s the script:
#pragma strict
var scrollViewVector : Vector2 = Vector2.zero;
var TextToDisplay : TextAsset;
function OnGUI () {
scrollViewVector = GUI.BeginScrollView (Rect (25, 25, 100, 100), scrollViewVector, Rect (0, 0, 400, 400));
GUILayout.Label(TextToDisplay);
GUI.EndScrollView();
}
The script is supposed to load a *.txt file. Any advice on what I’m doing wrong is welcome.