コード例 #1
0
    private IEnumerator DeathTransition(string extraData)
    {
        isTransitioning = true;

        deathMessage.GetComponentInChildren <TextMeshProUGUI>().CrossFadeAlpha(1f, 0f, false);

        yield return(StartCoroutine(Fade(new Color(0, 0, 0, 0), new Color(0, 0, 0, 1))));

        mCharacterImageCapture = GameObject.Find("CharacterImageCapture");
        CharacterModel model = mCharacterImageCapture.GetComponentInChildren <CharacterModel>();

        model.transform.localPosition = Vector3.zero;
        model.ChangeModel(Game.instance.followerData);

        deathSpeakerImage.gameObject.SetActive(true);
        StartCoroutine(FadeDeathSpeaker(new Color(0, 0, 0, 0), new Color(1, 1, 1, 1)));

        string msg = null;

        if (extraData == "success")
        {
            msg = LocalizedText.Get(LocalizedText.GetKeysInList("[DUNGEON_SUCCESS]").Sample());
        }
        else
        {
            msg = LocalizedText.Get(LocalizedText.GetKeysInList("[BREAKUP]").Sample());
        }

        if (!Game.instance.finishedTutorial)
        {
            msg = LocalizedText.Get("[BREAKUP_1]");
        }
        yield return(deathMessage.ShowTextCoroutine(msg, 1f, false));

        yield return(new WaitForSeconds(1f));

        deathMessage.GetComponentInChildren <TextMeshProUGUI>().CrossFadeAlpha(0f, 0.5f, false);
        yield return(StartCoroutine(FadeDeathSpeaker(new Color(1, 1, 1, 1), new Color(0, 0, 0, 0))));

        deathSpeakerImage.gameObject.SetActive(false);

        yield return(StartCoroutine(ShowUnlocks()));

        yield return(StartCoroutine(ChangeScene("HUB")));

        yield return(new WaitForSeconds(0.1f));

        yield return(StartCoroutine(Fade(new Color(0, 0, 0, 1), new Color(0, 0, 0, 0))));

        fullScreenQuad.gameObject.SetActive(false);

        deathMessage.gameObject.SetActive(false);

        isTransitioning = false;

        yield break;
    }