コード例 #1
0
    void OnConnect()
    {
        if (!string.IsNullOrEmpty(IpInput.text))
        {
            IP = IpInput.text;
        }
        if (!string.IsNullOrEmpty(PortInput.text))
        {
            port = int.Parse(PortInput.text);
        }
        cursor.ServerStart(IP, port);

        buttonText.text = "Disconnect";

        ColorBlock colorBlock = button.colors;

        colorBlock.normalColor      = new Color32(255, 105, 98, 255);
        colorBlock.highlightedColor = new Color32(236, 80, 83, 255);
        button.colors = colorBlock;

        EventSystem.current.SetSelectedGameObject(null);
        menuAnimator.SetBool("Open", false);
    }