예제 #1
0
    /// <summary>
    /// Sets the given character to have the given expression.
    /// </summary>
    /// <param name="charIdArg"></param>
    /// <param name="expressionArg"></param>
    public void SetCharacterPortraitExpression(string charIdArg, CharacterDialogueExpressionType expressionArg)
    {
        // get the given character's associated character portrait
        DialogueCharacterPortraitController charPortrait = GetCharacterPortraitInScene(charIdArg);

        // if portrait found
        if (charPortrait != null)
        {
            // set portrait's expression to given expression
            charPortrait.SetupCharacterExpression(expressionArg);
        }
    }
예제 #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();
    }