Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        // Force players to start
        if (startOpened)
        {
            controllerStop.gameObject.SetActive(false);
            StartPlayer();
        }
        else
        {
            startPlayer.onClick.AddListener(StartPlayer);
            controllerStop.onClick.AddListener(ReturnToStart);
        }

        // Only player 1 can use the pc
        if (id != 0)
        {
            controllerPc.gameObject.SetActive(false);
        }
        else
        {
            controllerPc.onClick.AddListener(delegate { UseStandardController(true); });
        }

        // Use other controllers
        controllerStandard.onClick.AddListener(delegate { UseStandardController(false); });
        controllerPhone.onClick.AddListener(UsePhoneController);

        // Set color in character menu
        clr = backgroundImage.color;
        characterClassMenu.SetColor(clr);

        //Set IpAddress
        if (ipAddressOutput != null)
        {
            Text ipAddress = ipAddressOutput.GetComponent <Text>();
            ipAddress.text = Server.LocalIPAddress();
        }

        // Return to controllers choice
        donotConnect.onClick.AddListener(ReturnToController);
        stopController.onClick.AddListener(ReturnToController);

        // Confirm/Cancel chosen character
        btnConfirm.onClick.AddListener(ConfirmCharacter);
        btnCancel.onClick.AddListener(CancelCharacter);

        parentCode.UpdateNavigation(true, this);
    }