Ejemplo n.º 1
0
    IEnumerator StageChangeEffect_corutine()
    {
        SKill1.SetActive(false);
        SKill2.SetActive(false);
        Grandfa.SetActive(false);
        npc.SetActive(false);
        Singleton.getInstance.untouched = false;
        float             duration          = 1.5f;
        WaitForEndOfFrame waitForEndOfFrame = new WaitForEndOfFrame();

        StageChangeEffect.transform.localPosition = new Vector3(1196, 312, -2);
        createpattern_sc.Clear();
        while (duration > 0.0f)
        {
            duration -= Time.deltaTime;
            StageChangeEffect.transform.localPosition = Vector3.MoveTowards(StageChangeEffect.transform.localPosition, new Vector3(70, 312, -2), 1600 * Time.smoothDeltaTime);
            yield return(waitForEndOfFrame);
        }

        if (Singleton.getInstance.stage == 999 || Singleton.getInstance.MyPosition == Inanis_map.WorldTree)
        {
            Singleton.getInstance.MyPosition = Inanis_map.WorldTree;
            Grandfa.SetActive(true);
            npc.SetActive(true);
            npcsc_sc.Start();
        }
        //
        if (Singleton.getInstance.MyPosition == Inanis_map.OasisEntrance)
        {
            SKill1.SetActive(true);
            SKill2.SetActive(true);
        }

        mapselector_sc.MapSelect(Singleton.getInstance.stage);
        MonsterDie();
        map_sc.Start();
        //

        yield return(new WaitForSeconds(0.1f));

        duration = 2;
        while (duration > 0.0f)
        {
            duration -= Time.deltaTime;
            StageChangeEffect.transform.localPosition = Vector3.MoveTowards(StageChangeEffect.transform.localPosition, new Vector3(-1200, 312, -2), 1600 * Time.smoothDeltaTime);
            yield return(waitForEndOfFrame);
        }
        Singleton.getInstance.untouched = true;
    }