public void execute(bool toFastForward)
    {
        int timeOfDay = GameObject.FindObjectOfType <Timelord>().getCurrentModulusTimestep();

        characterToSummon.isPresent = true;
        characterToSummon.locations[timeOfDay].locationName = GameObject.FindObjectOfType <SceneCatalogue>().getCurrentSceneName();
        characterToSummon.locations[timeOfDay].isInside     = GameObject.FindObjectOfType <SceneCatalogue>().getIsInInteriorScene();
        characterToSummon.locations[timeOfDay].isActive     = true;

        List <Character> charList = GameObject.FindObjectOfType <DialogueManager>().getAllCurrentLocalPresentConversationPartners();

        // For each character in present characters, if character is currently being summoned, fade in, otherwise snap in.
        for (int i = 0; i < charList.Count; i++)
        {
            if (charList[i].givenName == characterToSummon.givenName)
            {
                myAnimationMaestro.fadeInCharacterImage(i + 1, toFastForward ? 0.0f : fadeDuration);
            }
            else
            {
                myAnimationMaestro.setImageColor(GameObject.Find("Character " + (i + 1) + " Portrait").GetComponent <Image>(), new Color(255, 255, 255, 1));
            }
        }

        myAnimationMaestro.writeDescriptionText(textToWrite, GameObject.Find("TextPanel").GetComponentInChildren <Text>());
    }
Ejemplo n.º 2
0
    public void execute(bool toFastForward)
    {
        Action setCharacterPresentFalse = () =>
        {
            myDialogueManager.getCharacterForName(characterToRemove).isPresent  = false;
            myDialogueManager.getCharacterForName(characterToRemove).returnTime = myTimeLord.getCurrentTimestep() + 1;
        };

        List <Character> charList = GameObject.FindObjectOfType <DialogueManager>().getAllCurrentLocalPresentConversationPartners();

        for (int i = 0; i < charList.Count; i++)
        {
            if (charList[i].givenName.ToLower() == characterToRemove.ToLower())
            {
                if (!toFastForward)
                {
                    myAnimationMaestro.fadeOutCharacterImage(i + 1, fadeDuration);
                    myAnimationMaestro.StartCoroutine(myAnimationMaestro.delayGameCoroutine(fadeDuration, setCharacterPresentFalse));
                }
                else
                {
                    myAnimationMaestro.setImageColor(GameObject.Find("Character " + (i + 1) + " Portrait").GetComponent <Image>(), new Color(255, 255, 255, 0));
                    myDialogueManager.getCharacterForName(characterToRemove).isPresent  = false;
                    myDialogueManager.getCharacterForName(characterToRemove).returnTime = myTimeLord.getCurrentTimestep() + 1;
                }
            }
        }
        myAnimationMaestro.writeDescriptionText(textToWrite, GameObject.Find("TextPanel").GetComponentInChildren <Text>());
    }
    public void execute(bool toFastForward)
    {
        GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList.Add(characterToSummon);

        List <Character> charList = GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList;

        // For each character in present characters, if character is currently being summoned, fade in, otherwise snap in.
        //TODO: Maybe get rid of this for DateCutScene because charList doesn't rearrange like dialogueManager.getAllLocalCurrentEtc...
        for (int i = 0; i < charList.Count; i++)
        {
            if (charList[i].givenName == characterToSummon.givenName)
            {
                myAnimationMaestro.fadeInCharacterImage(i + 1, toFastForward ? 0.0f : fadeDuration);
            }
            else
            {
                myAnimationMaestro.setImageColor(GameObject.Find("Character " + (i + 1) + " Portrait").GetComponent <Image>(), new Color(255, 255, 255, 1));
            }
        }

        myAnimationMaestro.writeDescriptionText(textToWrite, GameObject.Find("TextPanel").GetComponentInChildren <Text>());
    }
    public void execute(bool toFastForward)
    {
        List <Character> charList     = GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList;
        int    charListIndexToRemove  = 0;
        Action removeCharFromCharList = () =>
        {
            GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList.RemoveAt(charListIndexToRemove);
            //If three char's in date cut scene and 2nd character leaves, 3rd character re-sorts to 2nd position, but doesn't have alpha
            for (int i = 0; i < GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList.Count; i++)
            {
                myAnimationMaestro.setImageColor(GameObject.Find("Character " + (i + 1) + " Portrait").GetComponent <Image>(), new Color(255, 255, 255, 1));
            }
        };

        // For each character in present characters, if character is currently being summoned, fade in, otherwise snap in.
        //TODO: Maybe get rid of this for DateCutScene because charList doesn't rearrange like dialogueManager.getAllLocalCurrentEtc...
        for (int i = 0; i < charList.Count; i++)
        {
            if (charList[i].givenName.ToLower() == characterToRemove.ToLower())
            {
                charListIndexToRemove = i;
                if (!toFastForward)
                {
                    myAnimationMaestro.fadeOutCharacterImage(i + 1, fadeDuration);
                    myAnimationMaestro.StartCoroutine(myAnimationMaestro.delayGameCoroutine(fadeDuration, removeCharFromCharList));
                }
                else
                {
                    myAnimationMaestro.setImageColor(GameObject.Find("Character " + (i + 1) + " Portrait").GetComponent <Image>(), new Color(255, 255, 255, 0));
                    GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList.RemoveAt(charListIndexToRemove);
                }
            }
        }

        myAnimationMaestro.writeDescriptionText(textToWrite, GameObject.Find("TextPanel").GetComponentInChildren <Text>());
    }
Ejemplo n.º 5
0
    public void execute(bool toFastForward)
    {
        GameObject.FindObjectOfType <CommandBuilder>().dateCutSceneCharList.Add(characterToSummon);

        myAnimationMaestro.writeDescriptionText(textToWrite, GameObject.Find("TextPanel").GetComponentInChildren <Text>());
    }
Ejemplo n.º 6
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);
        }
    }