private void Awake()
 {
     observable    = FindObjectOfType <Observable>();
     udp           = GetComponent <Udp>();
     nextState     = GetComponent <ClientProcessingState>();
     stoppingState = GetComponent <StoppingState>();
 }
예제 #2
0
        /// <summary>Attempts to connect to the server.</summary>
        public void ConnectToServer()
        {
            tcp = new Tcp();
            udp = new Udp();

            InitializeClientData();

            isConnected = true;
            tcp.Connect(); // Connect tcp, udp gets connected once tcp is done
        }
예제 #3
0
        public Room(int listeningPort, int sendingPort, ShipInfo[] ships)
        {
            physicsController = new PhysicsController();
            Body.SetPhysicsController(physicsController);
            shipsInfo       = ships;
            roomClosed      = false;
            lastId          = 0;
            bots            = new List <ShipController>();
            players         = new List <Player>();
            structConverter = new StructConverter();
            IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, listeningPort);

            udp                   = new Udp(localEndPoint);
            connector             = new TcpConnector(localEndPoint);
            projectilesController = new BaseProjectilesController(100);
        }
예제 #4
0
 private void Awake()
 {
     observable = FindObjectOfType <Observable>();
     udp        = FindObjectOfType <Udp>();
 }
예제 #5
0
 private void Awake()
 {
     observable = FindObjectOfType <Observable>();
     udp        = GetComponent <Udp>();
     inactive   = GetComponent <InactiveState>();
 }
예제 #6
0
 private void Awake()
 {
     observable = FindObjectOfType <Observable>();
     udp        = GetComponent <Udp>();
     stopping   = GetComponent <StoppingState>();
 }