Пример #1
0
    private void updateUIComponentsForState(GameState.gameStates currentState)
    {
        this.deactivateUIComponents();

        if (currentState == GameState.gameStates.COMMANDSEQUENCE)
        {
            mainPanel.SetActive(true);
            characterPanel.gameObject.SetActive(true);
            sequenceButtonsPanel.SetActive(true);
            updatePotentialPartnersSprites(myDialogueManager.getAllCurrentLocalPresentConversationPartners());
        }
        else if (currentState == GameState.gameStates.CUTSCENE)
        {
            updateUIForCutSceneState();
        }
        else if (currentState == GameState.gameStates.PROWL)
        {
            mainPanel.SetActive(true);
            mainPanelButtonsPanel.SetActive(true);
            mapButton.SetActive(!mySceneCatalogue.getIsInInteriorScene());
            characterPanel.gameObject.SetActive(true);

            toggleMainPanelIfUIEnabled(mapPanel, this.mapEnabled);
            toggleMainPanelIfUIEnabled(journalPanel, this.journalEnabled);

            if (mainPanel.activeSelf == true)
            {
                myAnimationMaestro.writeDescriptionText(mySceneCatalogue.getLocationDescription(), textPanel);
                updatePotentialPartnersSprites(myDialogueManager.getAllCurrentLocalPresentConversationPartners());
                updateSelectedPartnerButtonUI();
                updateToggleInteriorButtonUI();
            }
        }
        else if (currentState == GameState.gameStates.CONVERSATION)
        {
            dialoguePanel.SetActive(true);
            characterPanel.gameObject.SetActive(true);
            Image speakerPortrait = GameObject.Find("SpeakerPortrait").GetComponent <Image>();
            speakerPortrait.sprite = BackgroundSwapper.createSpriteFromTex2D(myConversationTracker.currentConversation.speaker.portrait);
            askOnDateButton.SetActive(myConversationTracker.canAskOnDateEnabled());
        }
        else if (currentState == GameState.gameStates.DATEINTRO)
        {
            mainPanel.SetActive(true);
            dateButtonsPanel.SetActive(myRelationshipCounselor.isAtDate);
            dateActionButton.SetActive(!myRelationshipCounselor.getDateAbandonedOrExperienced());
            dateActionButton.GetComponentInChildren <Text>().text = mySceneCatalogue.getCurrentLocation().currentDateAction;
            characterPanel.gameObject.SetActive(true);
            updatePotentialPartnersSprites(new List <Character>()
            {
                myRelationshipCounselor.getDatePartner(mySceneCatalogue.getCurrentLocation(), myTimelord.getCurrentTimestep())
            });
            myAnimationMaestro.writeDescriptionText(mySceneCatalogue.getCurrentLocation().descriptionDate, textPanel);
        }
        else if (currentState == GameState.gameStates.DATE)
        {
            mainPanel.SetActive(true);
            dateButtonsPanel.SetActive(myRelationshipCounselor.isAtDate);
            dateActionButton.SetActive(!myRelationshipCounselor.getDateAbandonedOrExperienced());
            dateActionButton.GetComponentInChildren <Text>().text = mySceneCatalogue.getCurrentLocation().currentDateAction;
            characterPanel.gameObject.SetActive(true);
            updatePotentialPartnersSprites(new List <Character>()
            {
                myRelationshipCounselor.getDatePartner(mySceneCatalogue.getCurrentLocation(), myTimelord.getCurrentTimestep())
            });
        }
        else if (currentState == GameState.gameStates.DATECUTSCENE)
        {
            mainPanel.SetActive(true);
            characterPanel.gameObject.SetActive(true);
            sequenceButtonsPanel.SetActive(true);
            updatePotentialPartnersSprites(GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList);
        }
        else if (currentState == GameState.gameStates.DATEOUTRO)
        {
            mainPanel.SetActive(true);
            dateButtonsPanel.SetActive(true);
            dateActionButton.SetActive(!myRelationshipCounselor.getDateAbandonedOrExperienced());
            myAnimationMaestro.writeDescriptionText("One good date can change your life.", textPanel);
        }
    }