Hey guys, anyone knows how to fix this error? It’s a result of me opening my Dialogue Editor Window after a long time… :
DrawGUITexture: texture is null
UnityEngine.GUI:DrawTextureWithTexCoords (UnityEngine.Rect,UnityEngine.Texture,UnityEngine.Rect)
RPG.Dialogue.Editor.DialogueEditor:OnGUI () (at Assets/Project Backup/Scripts/Dialogue/Editor/DialogueEditor.cs:120)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
and this is the ‘DialogueEditor.OnGUI()’ function the error is leading me to (and I commented line 120 beside the respective line):
private void OnGUI() {
if (selectedDialogue == null) {
EditorGUILayout.LabelField("No Dialogue Selected.");
}
else {
ProcessEvents();
scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); // ends with 'EditorGUILayout.EndScrollView()' below
Rect canvas = GUILayoutUtility.GetRect(canvasSize, canvasSize); // creates virtual space so we can horizontally scroll our Dialogue Editor (to make it bigger, increment this number)
Texture2D backgroundTex = Resources.Load("background") as Texture2D;
Rect texCoords = new Rect(0, 0, canvasSize/backgroundSize, canvasSize/backgroundSize);
GUI.DrawTextureWithTexCoords(canvas, backgroundTex, texCoords); // line 120
foreach (DialogueNode node in selectedDialogue.GetAllNodes())
{
DrawConnections(node);
}
foreach (DialogueNode node in selectedDialogue.GetAllNodes()) {
DrawNode(node);
}
EditorGUILayout.EndScrollView();
if (creatingNode != null) {
selectedDialogue.CreateNode(creatingNode);
creatingNode = null; // stops creating more than one node
}
if (deletingNode != null) {
selectedDialogue.DeleteNode(deletingNode);
deletingNode = null;
}
}
}
(if Brian sees this, please respond to this after the tutorial ;P)