예제 #1
0
 private void Awake()
 {
     Instance = this;
     DontDestroyOnLoad(gameObject); // 切换场景后也不能让他销毁掉
     client = new ClientPeer();
     client.Connect("127.0.0.1", 6666);
 }
예제 #2
0
 private void Awake()
 {
     Instance = this;
     //连接以后不摧毁连接体,这样进入下一个场景还能保持网络连接
     DontDestroyOnLoad(gameObject);
     client = new ClientPeer();
     client.Connect("127.0.0.1", 6666);
 }
예제 #3
0
    private void Awake()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

        client = new ClientPeer();
        client.Connect("39.98.40.96", 6666);
    }
예제 #4
0
    private void Awake()
    {
        Instance = this;
        DontDestroyOnLoad(gameObject);

        client = new ClientPeer();
        client.Connect("127.0.0.1", 8080);
    }