Hello,
I have a UISlider and I want to register a callback for OnValue change.
I tried it, but I am stuck and I think it is just a small issue.
I also want to change the Slider value too.
My Methodology:I have a public UISlider variable which I used to drag and drop the GameObject on top it.
public UISlider MySlider;
Then in OnEnable()
MySlider.onChange +=OnSliderValueChange;
I am trying to register a callback. My callback method is like this.
public void OnSliderValueChange(float val)
{
Debug.Log("Sound Value = " + val);
}
I think it is a
syntax error.
As it say this
Operator `+=' cannot be applied to operands of type `System.Collections.Generic.List<EventDelegate>' and `method group'
How can I register a callback?
My Secondary Question:As now I have cached the UISlider - how can I change the value on the slider from an external script.
Thank you very much!!!
EDIT :Even when I try this -
http://s11.postimg.org/yl2ljcpyr/Screen_Shot_2013_10_19_at_7_05_35_PM.pngI do not have any public methods shown up on the drag list. The gameobject which is attached to "Notify" monobehaviour has more than 1 script attached.