Ejemplo n.º 1
0
    protected override IEnumerator SetUp()
    {
        yield return(base.SetUp());

        view = PlayerInfoCardHUDView.CreateView();
        view.Initialize(null, null, null, null, null, null, null, null);

        CreateMockWearableByRarity(WearableLiterals.ItemRarity.EPIC);
        CreateMockWearableByRarity(WearableLiterals.ItemRarity.LEGENDARY);
        CreateMockWearableByRarity(WearableLiterals.ItemRarity.MYTHIC);
        CreateMockWearableByRarity(WearableLiterals.ItemRarity.RARE);
        CreateMockWearableByRarity(WearableLiterals.ItemRarity.UNIQUE);

        UserProfileController.i.AddUserProfileToCatalog(new UserProfileModel()
        {
            userId      = "userId",
            name        = "username",
            description = "description",
            email       = "email",
            inventory   = new string[]
            {
                WearableLiterals.ItemRarity.EPIC,
                WearableLiterals.ItemRarity.LEGENDARY,
                WearableLiterals.ItemRarity.MYTHIC,
                WearableLiterals.ItemRarity.RARE,
                WearableLiterals.ItemRarity.UNIQUE,
            }
        });

        userProfile = UserProfileController.userProfilesCatalog.Get("userId");
    }
    public PlayerInfoCardHUDController()
    {
        view = PlayerInfoCardHUDView.CreateView();
        view.Initialize(() => { OnCloseButtonPressed(); }
                        , ReportPlayer, BlockPlayer, UnblockPlayer,
                        AddPlayerAsFriend, CancelInvitation, AcceptFriendRequest, RejectFriendRequest);
        currentPlayerId           = Resources.Load <StringVariable>(CURRENT_PLAYER_ID);
        currentPlayerId.OnChange += OnCurrentPlayerIdChanged;
        OnCurrentPlayerIdChanged(currentPlayerId, null);

        toggleFriendsTrigger              = Resources.Load <InputAction_Trigger>("ToggleFriends");
        toggleFriendsTrigger.OnTriggered -= OnCloseButtonPressed;
        toggleFriendsTrigger.OnTriggered += OnCloseButtonPressed;

        closeWindowTrigger              = Resources.Load <InputAction_Trigger>("CloseWindow");
        closeWindowTrigger.OnTriggered -= OnCloseButtonPressed;
        closeWindowTrigger.OnTriggered += OnCloseButtonPressed;

        toggleWorldChatTrigger              = Resources.Load <InputAction_Trigger>("ToggleWorldChat");
        toggleWorldChatTrigger.OnTriggered -= OnCloseButtonPressed;
        toggleWorldChatTrigger.OnTriggered += OnCloseButtonPressed;
    }