コード例 #1
0
    /// <summary>
    /// <para>Coroutine that checks if the player ran out of power or if a route was found for the main character.
    /// </para>
    /// <para>If any of those two things happened, start the coroutine to end the current stage.</para>
    /// </summary>
    private IEnumerator CheckEndGame()
    {
        if (_upPower == 0 && _downPower == 0)
        {
            yield return(new WaitForSeconds(2f));

            if (traveler.GetComponent <Pathfinding>().Path.Count == 0)
            {
                StartCoroutine(FadeOut(false, false));
            }
        }
    }