Ok, the GUI.SetNextControlName doesn’t seem to work with Scrollview. Can anyone see the flaw in this?
using UnityEngine;
using System.Collections;
public class ScrollviewTest : MonoBehaviour {
private Vector2 scrollViewVector = new Vector2();
void OnGUI()
{
if (GUI.GetNameOfFocusedControl() == "testingScrollView")
{
Debug.Log("GUI.GetNameOfFocusedControl (): " + GUI.GetNameOfFocusedControl());
}
GUI.SetNextControlName("testingScrollView");
scrollViewVector = GUI.BeginScrollView(new Rect(0, 0, 350, 150), scrollViewVector, new Rect(0, 0, 325, 1000));
if (GUI.Button(new Rect(0, 0, 325, 100), "I am a button"))
{
Debug.Log("I Clicked the magical candy like button!");
}
GUI.EndScrollView();
}
}