Beispiel #1
0
 static public int StartCoroutine(IntPtr l)
 {
     try {
         MonoBehaviourProxy             self = (MonoBehaviourProxy)checkSelf(l);
         System.Collections.IEnumerator a1;
         checkType(l, 2, out a1);
         self.StartCoroutine(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #2
0
    public void Init(GameObject obj, MonoBehaviourProxy mb)
    {
        string s = "test test test from cs2lua !";

        Debug.Log(s);

        mb.StartCoroutine(this.TestCoroutine());

        root = new GameObject("root");

        var slider   = GameObject.Find("Canvas/Slider").GetComponent(typeof(UnityEngine.UI.Slider)) as UnityEngine.UI.Slider;
        var counttxt = GameObject.Find("Canvas/Count").GetComponent(typeof(UnityEngine.UI.Text)) as UnityEngine.UI.Text;

        slider.onValueChanged.AddListener((float v) => {
            Reset();
            counttxt.text = LuaString.Format("cube:{0}", v);
            max           = (int)v;
        });
        Reset();
    }