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>());
    }
Example #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)
    {
        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>());
    }
    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>());
    }