// Start is called before the first frame update
    void Awake()
    {
        pMovement     = PlexiObject.GetComponent <Hard_PlexiMovement>();
        ballTransform = ballObject.GetComponent <RectTransform>();

        originXPosition = ballTransform.position.x;     // Save initial position of the ball
        originYPosition = ballTransform.position.y;
    }
Beispiel #2
0
    private void Awake()
    {
        hpMovement = plexiObject.GetComponent <Hard_PlexiMovement>();

        clientsSender        = new List <ServerClient>();
        disconnectListSender = new List <ServerClient>();

        clientsReceiver        = new List <ServerClient>();
        disconnectListReceiver = new List <ServerClient>();

        clientsMobile        = new List <ServerClient>();
        disconnectListMobile = new List <ServerClient>();

        IPAddress temp = IPAddress.Any;

        try
        {
            serverSender = new TcpListener(temp, portSender);
            serverSender.Start();

            serverReceiver = new TcpListener(temp, portReceiver);
            serverReceiver.Start();

            serverMobile = new TcpListener(temp, portMobile);
            serverMobile.Start();

            StartListening();

            serverSenderStarted   = true;
            serverReceiverStarted = true;
            serverMobileStarted   = true;

            serverStatus.text = "Ip " + temp + " Port " + portSender;
        }
        catch (Exception e)
        {
            Debug.Log("Socket Error: " + e.Message);
            serverStatus.text = "Socket Error: " + e.Message;
        }

        clientSide = ClientSideObject.GetComponent <ClientSide>();
        clientSide.SendWithParameter("Desktop Client Initialized.");
    }
Beispiel #3
0
 private void Start()
 {
     hpMovement = plexiObject.GetComponent <Hard_PlexiMovement>();
 }