using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour
{
public Game gamescript;
public UILabel label;
void Awake()
{
UIProgressBar pg = GetComponent<UIProgressBar>();
EventDelegate.Add(pg.onChange, MyFunc);//1
EventDelegate.Add(pg.onChange, gamescript.MyFunc);//trying to call method from other class//2
EventDelegate.Add(pg.onChange, Func);//3
}
void MyFunc ()
{
float NegativeOneToOne = UIProgressBar.current.value * 100.0F - 50.0F; // make 0 to 1 slider value mapped to -1 to 1
label.text = NegativeOneToOne.ToString("F");
}
void Func()
{
Debug.Log ("Called");
}
}