예제 #1
0
    public void ShowItemScreenProperly()
    {
        view.ShowItemScreen(new AirdroppingHUDController.ItemModel()
        {
            name         = "item",
            rarity       = "rare",
            subtitle     = "subtitle",
            type         = "collectible",
            thumbnailURL = "url"
        }, 1);

        AirdroppingItemPanel itemPanel = view.singleItemContainer.GetComponentInChildren <AirdroppingItemPanel>();

        Assert.IsTrue(view.singleItemScreen.activeSelf);
        Assert.AreEqual("1", view.itemsLeft.text);
        Assert.NotNull(itemPanel);
        Assert.AreEqual("item", itemPanel.name.text);
        Assert.AreEqual("subtitle", itemPanel.subtitle.text);
    }
    public void ApplyState()
    {
        switch (currentState)
        {
        case State.Initial:
            currentItemShown = 0;
            view.SetContentActive(true);
            view.ShowInitialScreen(model.title, model.subtitle);
            break;

        case State.SingleItem:
            view.ShowItemScreen(model.items[currentItemShown], model.items.Length - (currentItemShown + 1));
            break;

        case State.Summary:
            view.ShowSummaryScreen(model.items);
            break;

        case State.Summary_NoItems:
            view.ShowSummaryNoItemsScreen();
            break;

        case State.Finish:
            WebInterface.SendUserAcceptedCollectibles(model.id);

            OnAirdropFinished?.Invoke();

            MoveToNextState();
            break;

        case State.Hidden:
        default:
            model = null;
            view.SetContentActive(false);
            break;
        }
    }