Esempio n. 1
0
    // Button activated
    private void OnMouseUpAsButton()
    {
        // Pausing the draft
        if (currentSprite == pauseSprite)
        {
            timerScript.GoToDraftState(DraftState.DraftPaused);
            currentSprite      = playSprite;
            currentHoverSprite = playHoverSprite;
        }
        else
        {
            // Continue the draft
            timerScript.SwapDraftState();
            currentSprite      = pauseSprite;
            currentHoverSprite = pauseHoverSprite;
        }

        // Ensure we get our new hover sprite in place
        this.GetComponent <SpriteRenderer>().sprite = currentHoverSprite;
    }
Esempio n. 2
0
    private void SwitchToTradeState(TradeState newTradeState)
    {
        this.tradeState = newTradeState;

        switch (this.tradeState)
        {
        case TradeState.NotTrading:
            timerScript.SwapDraftState();

            // Reset all trade stuffs.
            this.leftSide.transform.DOMove(this.leftSideHidePosition, timerScript.quickAnimationTime);
            this.rightSide.transform.DOMove(this.rightSideHidePosition, timerScript.quickAnimationTime).OnComplete(this.ResetTradeStuffs);
            this.tradeText.transform.DOMove(this.tradeTextObjectHidePosition, timerScript.quickAnimationTime);
            this.parentTradePlayerButtonsObject.transform.DOMove(this.tradePlayerButtonArrayHidePosition, timerScript.quickAnimationTime);
            this.parentConfirmationScreen.transform.DOMove(this.confirmationScreenHide, timerScript.quickAnimationTime);
            this.nextTradeButton.GetComponent <NextTradeButton>().Hide();

            foreach (var nameplate in this.tradeNameplates)
            {
                GameObject.Destroy(nameplate);
            }
            this.tradeNameplates.Clear();

            this.firstDrafterTradeCapital.Clear();
            this.secondDrafterTradeCapital.Clear();
            break;

        case TradeState.ChooseFirstPlayer:
            // Show all the drafter stuff.
            this.leftSide.transform.DOMove(Vector3.zero, timerScript.quickAnimationTime);
            this.rightSide.transform.DOMove(Vector3.zero, timerScript.quickAnimationTime);

            this.tradeText.transform.DOMove(this.tradeTextObjectShowPosition, timerScript.quickAnimationTime);
            this.tradeText.GetComponent <TextMeshPro>().text = "Choose First Drafter:";
            break;

        case TradeState.ChooseSecondPlayer:
            this.tradeText.GetComponent <TextMeshPro>().text = "Choose Second Drafter:";
            break;

        case TradeState.ChooseFirstPlayerTrade:
            // Hide all the drafter stuff.
            this.leftSide.transform.DOMove(this.leftSideHidePosition, timerScript.quickAnimationTime);
            this.rightSide.transform.DOMove(this.rightSideHidePosition, timerScript.quickAnimationTime);

            this.SetupPlayerButtonsFor(this.firstDrafter);

            this.nextTradeButton.GetComponent <NextTradeButton>().Show();
            break;

        case TradeState.ChooseSecondPlayerTrade:
            this.parentTradePlayerButtonsObject.transform.DOMove(this.tradePlayerButtonArrayHidePosition, timerScript.quickAnimationTime).OnComplete(() => this.SetupPlayerButtonsFor(this.secondDrafter));
            break;

        case TradeState.ConfirmTrade:
            // Hide button array.
            // Show trade confirmation.
            this.tradeText.transform.DOMove(this.tradeTextObjectHidePosition, timerScript.quickAnimationTime);
            this.parentTradePlayerButtonsObject.transform.DOMove(this.tradePlayerButtonArrayHidePosition, timerScript.quickAnimationTime).OnComplete(this.BuildAndShowConfirmation);
            this.nextTradeButton.GetComponent <NextTradeButton>().Hide();
            break;
        }
    }