private void drawTreeArea() { // scrollPosition = GUILayout.BeginScrollView(scrollPosition, true, true); Rect canvasRect = new Rect(0, 0, canvasSize * 2, canvasSize * 2); Texture2D bgTex = Resources.Load("background") as Texture2D; Rect coord = new Rect(0, 0, canvasSize / bgTextureSize, canvasSize / bgTextureSize); GUI.DrawTextureWithTexCoords(canvasRect, bgTex, coord); foreach (BehaviourTreeTask node in selectedBehaviour.GetNodes()) { DrawConnections(node); } foreach (BehaviourTreeTask node in selectedBehaviour.GetNodes()) { DrawNode(node); } // GUILayout.EndScrollView(); }