Esempio n. 1
0
    /// <summary>
    /// Turns off a character portrait to denote it is no longer being used.
    /// </summary>
    /// <param name="charPortraitArg"></param>
    private void DeactivateCharacterPortrait(DialogueCharacterPortraitController charPortraitArg)
    {
        // remove portrait's associated character
        charPortraitArg.SetupCharacterData(null);

        /// deactivate the dialogue portrait to denote character leaving scene and freeing
        /// up a dialogue portrait for use
        charPortraitArg.gameObject.SetActive(false);
    }
Esempio n. 2
0
    /// <summary>
    /// Places the associated character portrait in the dialogue scene.
    /// </summary>
    /// <param name="charIdArg"></param>
    public void CharacterPortraitEnterDialogueScene(string charIdArg, CharacterDialogueExpressionType expressionArg)
    {
        // if character portrait is already in scene
        if (IsCharacterPortraitInScene(charIdArg))
        {
            // DONT continue code
            return;
        }

        // get character data for given char ID
        CharacterData charInDialogueScene = GetCharacterInDialogueScene(charIdArg);

        // if char data WAS found
        if (charInDialogueScene != null)
        {
            // get an unused character portrait
            DialogueCharacterPortraitController unusedPort = GetUnusedCharacterPortrait();

            // if an available dialogue portrait was found
            if (unusedPort != null)
            {
                // assign the character data to the dialogue portrait
                unusedPort.SetupCharacterData(charInDialogueScene);
                // asign the character's expression to the dialogue portrait
                unusedPort.SetupCharacterExpression(expressionArg);

                // activate the portrait
                unusedPort.gameObject.SetActive(true);

                /*// set new portrait's position to their appropriate position
                 * unusedPort.transform.position = GetAppropriateDialoguePortraitPosition(
                 *  GetActiveDialoguePortraits().Count, GetDialoguePortaitOrderNumber(charIdArg));*/

                // play appear animation for the dialogue portrait
                unusedPort.PlayAnimationAppear();

                // set the entering character as the character that is currently speaking
                //SetCharSpeaker(charInDialogueScene);
            }
        }

        // moves all active character portraits to their appropriate positions
        RefreshDialoguePortraitPositions();
    }