Ejemplo n.º 1
0
 public static void KillTimer(MeTimer timer)
 {
     if (timer != null)
     {
         timer.close = true;
     }
 }
Ejemplo n.º 2
0
 static public int set_onCompleted(IntPtr l)
 {
     try {
         MeTimer            self = (MeTimer)checkSelf(l);
         Callback <MeTimer> v;
         int op = LuaDelegation.checkDelegate(l, 2, out v);
         if (op == 0)
         {
             self.onCompleted = v;
         }
         else if (op == 1)
         {
             self.onCompleted += v;
         }
         else if (op == 2)
         {
             self.onCompleted -= v;
         }
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 3
0
 static public int get_close(IntPtr l)
 {
     try {
         MeTimer self = (MeTimer)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.close);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 4
0
 static public int constructor(IntPtr l)
 {
     try {
         MeTimer o;
         o = new MeTimer();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 5
0
 static public int set_id(IntPtr l)
 {
     try {
         MeTimer      self = (MeTimer)checkSelf(l);
         System.Int32 v;
         checkType(l, 2, out v);
         self.id = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 6
0
    public static MeTimer AddTimer(float interval, int loop, Callback <MeTimer> onTimerHander)
    {
        if (LuaMeTimer.obj == null)
        {
            LuaMeTimer.obj = new GameObject("~MeLuaTimer");
            LuaMeTimer.obj.AddComponent <LuaMeTimer>();
            GameObject meGo = GameObject.Find("~ME~");
            if (meGo == null)
            {
                meGo = new GameObject("~ME~");
            }
            LuaMeTimer.obj.transform.SetParent(meGo.transform);
        }
        MeTimer timer = new MeTimer();

        timer.onTimer  = onTimerHander;
        timer.interval = interval;
        timer.loop     = loop;

        LuaMeTimer.TimerList.Add(timer);

        return(timer);
    }
Ejemplo n.º 7
0
 public static void KillTimer(MeTimer timer)
 {
     if (timer != null)
     {
         timer.close = true;
     }
 }
Ejemplo n.º 8
0
    public static MeTimer AddTimer(float interval, int loop, Callback<MeTimer> onTimerHander)
    {
        if (LuaMeTimer.obj == null)
        {
            LuaMeTimer.obj = new GameObject("~MeLuaTimer");
            LuaMeTimer.obj.AddComponent<LuaMeTimer>();
            GameObject meGo = GameObject.Find("~ME~");
            if (meGo == null)
            {
                meGo = new GameObject("~ME~");
            }
            LuaMeTimer.obj.transform.SetParent(meGo.transform);
        }
        MeTimer timer = new MeTimer();
        timer.onTimer = onTimerHander;
        timer.interval = interval;
        timer.loop = loop;

        LuaMeTimer.TimerList.Add(timer);

        return timer;
    }