Esempio n. 1
0
    public void Start()
    {
        invitations      = new Dictionary <string, User>();
        allInvitationObj = new Dictionary <string, GameObject>();
        Avatar           = new Avatar();

        playerVsPlayerContainer.SetActive(false);
        playerVsComputerContainer.SetActive(false);
        startGameContainer.SetActive(false);
        userUIContainer.SetActive(false);
        gameLobbyContainer.SetActive(false);
        MainMenuContainer.SetActive(false);
        signInContainer.SetActive(true);
        MenuUserContainer.SetActive(false);
        isProfileMenuShow  = false;
        isUpdateAvatar     = false;
        isClosedEditAvatar = false;

        NetworkClient.OnSignInComplete  += OnSignInComplete;
        NetworkClient.OnStateChange     += OnStateChange;
        NetworkClient.OnSignInUpMessage += OnSignInUpMessage;
        NetworkClient.UpdateUsernameEnd += UpdateUsernameEnd;
        NetworkClient.UpdatePasswordEnd += UpdatePasswordEnd;
        NetworkClient.UpdateAvatarEnd   += UpdateAvatarEnd;
    }
Esempio n. 2
0
    private void Update()
    {
        if (GameLobby.isClosedGameLooby)
        {
            sendInvitationConatiner.SetActive(false);
            playerVsPlayerContainer.SetActive(false);
            playerVsComputerContainer.SetActive(false);
            startGameContainer.SetActive(false);
            gameLobbyContainer.SetActive(false);
            signInContainer.SetActive(false);
            MenuUserContainer.SetActive(false);
            receiveInvitationContainer.SetActive(false);
            userUIContainer.SetActive(true);
            MainMenuContainer.SetActive(true);
            UIContainer.SetActive(true);
            GameLobby.isClosedGameLooby = false;
        }

        if (isUpdateAvatar && isClosedEditAvatar)
        {
            Image  avatar     = ProfileContainer.transform.Find("[ProfileUser]").Find("AvatarNameContainer").Find("Avatar").Find("Image").GetComponent <Image>();
            string nameAvatar = NetworkClient.users[NetworkClient.clientID].avatar;
            Avatar.DisplayAvatar(avatar, nameAvatar);
            isUpdateAvatar     = false;
            isClosedEditAvatar = false;
        }
    }
Esempio n. 3
0
 public void OnClickProfileMenu()
 {
     isProfileMenuShow = isProfileMenuShow == true?false:true;
     MenuUserContainer.SetActive(isProfileMenuShow);
 }