コード例 #1
0
ファイル: TimeItem.cs プロジェクト: LatestMatrix/rpg1
 public void Reset(CallBackFun f, CallBackRemoveFun rf, float intervalTime, int time)
 {
     id        = UID++;
     fun       = f;
     removeFun = rf;
     total     = time;
     cur       = 0;
     InvokeRepeating("back", intervalTime, intervalTime);
     isStop = false;
 }
コード例 #2
0
ファイル: Timer.cs プロジェクト: LatestMatrix/rpg1
 public static TimeItem GetTimer(CallBackFun fun)
 {
     foreach (TimeItem i in _items)
     {
         if (i.fun == fun)
         {
             return(i);
         }
     }
     return(null);
 }
コード例 #3
0
ファイル: H5Helper.cs プロジェクト: jjzhang166/FxLib
    public static IEnumerator SendPost(string _url, WWWForm _wForm, CallBackFun cbf)
    {
        WWW postData = new WWW(_url, _wForm);

        yield return(postData);

        if (postData.error != null)
        {
            H5LogStr(postData.error);
        }
        else
        {
            cbf(postData.text);
        }
    }
コード例 #4
0
ファイル: H5Helper.cs プロジェクト: jjzhang166/FxLib
    public static IEnumerator SendGet(string _url, CallBackFun cbf)
    {
        WWW getData = new WWW(_url);

        yield return(getData);

        if (getData.error != null)
        {
            H5LogStr(getData.error);
        }
        else
        {
            cbf(getData.text);
        }
    }
コード例 #5
0
ファイル: TimeItem.cs プロジェクト: LatestMatrix/rpg1
    public static TimeItem Init(CallBackFun fun, CallBackRemoveFun rf, float intervalTime, int time)
    {
        if (_obj == null)
        {
            _obj = GameObject.Find("Timer");
        }
        TimeItem ins = _obj.AddComponent <TimeItem>();

        ins.id        = UID++;
        ins.fun       = fun;
        ins.removeFun = rf;
        ins.total     = time;
        ins.cur       = 0;
        ins.InvokeRepeating("back", intervalTime, intervalTime);
        ins.isStop = false;
        return(ins);
    }
コード例 #6
0
ファイル: Timer.cs プロジェクト: LatestMatrix/rpg1
    public static int AddTimer(CallBackFun fun, float intervalTime, int time = 1)
    {
        TimeItem item = GetTimer(fun);

        if (item != null)
        {
            RemoveTimer(item);
        }
        if (_idles.Count > 0)
        {
            item = _idles[0];
            _idles.RemoveAt(0);
            item.Reset(fun, RemoveTimer, intervalTime, time);
        }
        else
        {
            item = TimeItem.Init(fun, RemoveTimer, intervalTime, time);
        }
        _items.Add(item);
        return(item.id);
    }
コード例 #7
0
ファイル: ftc.cs プロジェクト: CodFrm/fts
        public ftc(string sIp, int port = 5209, CallBackFun fun = null)
        {
            if (fun != null)
            {
                SetCallBack(fun);
            }
            try
            {
                IPAddress  ip  = IPAddress.Parse(sIp);
                IPEndPoint ipe = new IPEndPoint(ip, port);
                client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                client.Connect(ipe);
            }
            catch (Exception)
            {
                backFun(-1, "连接失败");
                return;
            }
            Thread thread = new Thread(new ThreadStart(RecvThread));

            thread.Start();
        }
コード例 #8
0
ファイル: ftc.cs プロジェクト: CodFrm/fts
 public void SetCallBack(CallBackFun fun)
 {
     this.backFun = fun;
 }
コード例 #9
0
ファイル: ftc.cs プロジェクト: CodFrm/fts
 public ftc(string sIp, CallBackFun fun) : this(sIp, 5209, fun)
 {
 }
コード例 #10
0
 public Titan2Controller()
 {
     InitSession = new CallBackFun(MyInitSession);
     EncryptKey  = System.Configuration.ConfigurationManager.AppSettings["EncryptKey"].ToString();;
     log_level   = System.Configuration.ConfigurationManager.AppSettings["LogLevel"].ToInt();
 }
コード例 #11
0
        private void UpdateStatusThread(int status)
        {
            CallBackFun c = new CallBackFun(UpdateStatus);

            this.Dispatcher.Invoke(c, status);
        }
コード例 #12
0
ファイル: UniDAQ.cs プロジェクト: gish5505/ControlDevice
 public static extern UInt16 Ixud_SetEventCallback(UInt16 wBoardNo, UInt16 wEventType, UInt16 wIntSource, ref UInt32 hEvent, CallBackFun CallbackFunction, UInt32 dwCallbackParameter);
コード例 #13
0
 public HomeController()
 {
     InitSession = new CallBackFun(MyInitSession);
     EncryptKey  = System.Configuration.ConfigurationManager.AppSettings["EncryptKey"].ToString();;
 }
コード例 #14
0
ファイル: HRobot.cs プロジェクト: HIWINCorporation/hiwin_sdk
 public static extern int open_connection(String a, int mode, CallBackFun func);