Ejemplo n.º 1
0
    /// <summary>
    /// Muestra todo lo que haya en el string logAsText en el GUI.
    /// </summary>
    public void DisplayLoggedText()
    {
        string logAsText = string.Join("\n", actionLog.ToArray());

        if (currentDisplayText == null)
        {
            StopCoroutine("AnimateText");
            oldText             = "\n";
            currentCharPosition = 0;
            CreateNewDisplay();
            writing     = false;
            stopWriting = false;
            currentDisplayText.autoSizeTextContainer = false;
            currentDisplayText.autoSizeTextContainer = true;
        }

        if (writing)
        {
            stopWriting = true;
        }

        playerText.updateText();

        StartCoroutine(AnimateText(logAsText));
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Cambia el tituloo del jugador para reflejar su CharacterEffectiveState actual.
    /// </summary>
    public void ChangePlayerState()
    {
        string state = "";

        playerText.updateText();

        if (player.currentState != player.defaultState)
        {
            state = " <" + TextConverter.MakeFirstLetterUpper(player.currentState.stateName) + ">";
            UpdatePlayerLog("¡Has entrado en " + TextConverter.MakeFirstLetterUpper(player.currentState.stateName)
                            + "!");
        }

        playerUI.title.text = "<b>" + TextConverter.MakeFirstLetterUpper(player.playerName) + "</b>" + "\n" +
                              TextConverter.MakeFirstLetterUpper(player.characteristics.playerRace.raceName) + " " +
                              TextConverter.MakeFirstLetterUpper(player.characteristics.playerJob.jobName) +
                              state;

        if (vsPlayer)
        {
            NetworkManager.Instance.UpdatePlayerData(enemyPlayer, player);
        }
    }
Ejemplo n.º 3
0
    public IEnumerator ChargeLife()
    {
        while (isAlive)
        {
            yield return(new WaitForSecondsRealtime(1));

            currentHealth += characteristics.other.currentHealthRegenPerSecond;

            playerText.updateText();

            if (currentHealth >= maxHealth)
            {
                currentHealth = maxHealth;
            }
            if (GameState.Instance.CurrentState == GameState.GameStates.combat)
            {
                controller.combatController.UpdatePlayerLife();
            }
        }
    }