public static JFSocket GetInstance() { if (instance == null) { instance = new JFSocket(); } return(instance); }
public void disConnect() { if (_net != null) { _net.Closed(); if (PlayerSys.getSingleton().getHero() != null) { PlayerSys.getSingleton().getHero().NotifyRemove("all"); } _net = null; } }
public virtual void Start() { mJFsorket = JFSocket.GetInstance(); MaxHp = 100; CurrentHp = 100; MaxSpeed = 0.3f; Speed_a = 1; ship = this.gameObject; slider = GameObject.FindGameObjectWithTag("Slider").GetComponent <Slider>(); slider.maxValue = MaxHp; slider.minValue = 0; setSlider(CurrentHp); }
public void connect(string ip, int port, System.Action <object> connectedCB) { if (false == isConnected()) { _net = JFSocket.getInstance(); if (connectedCB == null) { _net.connect(ip, port, OnConnected); } else { _net.connect(ip, port, connectedCB); } } }
// Use this for initialization void Start() { mJFsorket = JFSocket.GetInstance(); }
// Use this for initialization void Start() { mJFsocket = JFSocket.GetInstance(); req = "{\"bean\":\"login\",\"method\":\"login\",\"param\":{\"sss\":1,\"token\":\"12345678901234567890123456789012999\"}}"; }