private void Awake() { observable = FindObjectOfType <Observable>(); udp = GetComponent <Udp>(); nextState = GetComponent <ClientProcessingState>(); stoppingState = GetComponent <StoppingState>(); }
/// <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 }
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); }
private void Awake() { observable = FindObjectOfType <Observable>(); udp = FindObjectOfType <Udp>(); }
private void Awake() { observable = FindObjectOfType <Observable>(); udp = GetComponent <Udp>(); inactive = GetComponent <InactiveState>(); }
private void Awake() { observable = FindObjectOfType <Observable>(); udp = GetComponent <Udp>(); stopping = GetComponent <StoppingState>(); }