//public delegate bool ChatMessageHandler(string msg);
    //public event ChatMessageHandler SendChatMessage;
    /**
     * start will locate the inputfield and attach a listener.
     * It will also locate the websockets client and listen for messages of the "chat" format.
     * chat messages should be pretty printed and added to the chat output window
     */
    void Start()
    {
        //from the input field, listen for submissions (check for the enter)
        chatInput = GetComponent<InputField>();
        chatInput.onEndEdit.AddListener(submitted);

        GameObject GameController = GameObject.FindGameObjectWithTag("GameController");
        pongCoordinator = GameController.GetComponent<PongCoordinator>();
    }
Beispiel #2
0
    void Start()
    {
        menuVisible = true;
        if (totalMenu != null) totalMenu.SetActive(true);
        Debug.Log("Start: activated boolean");

        GameObject PongController = GameObject.FindGameObjectWithTag("GameController");
        coordinator = PongController.GetComponent<PongCoordinator>();

        playerNameInput.onEndEdit.AddListener(PlayerNameChanged);

        addressInput.text = "ws://" + Network.player.ipAddress + ":8080";
    }