I want to have one textfield which is able to set and get value to and form scrollbar. Here is my code:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
private float scrolledVal;
private float temVal;
void OnGUI()
{
scrolledVal = GUI.HorizontalScrollbar (new Rect(20, 20, 100, 30), scrolledVal, 1.0F, 33f, 58f);
scrolledVal = float.Parse(GUI.TextField (new Rect(130, 20, 50, 20), scrolledVal.ToString()));
}
}
That I can only get the value from scrollbar, but I cannot set value scrolled to scrollbar. Please help.