Ejemplo n.º 1
0
    IEnumerator _MoveToPos()
    {
        float _Dir1 = transform.position.x - StageManagerSC._LumiaInst.transform.position.x;
        int   _Dir2 = _Dir1 > 0 ? 1 : _Dir1 < 0 ? -1 : 0;

        _LSC._AutoWalk = _Dir2;
        while (0 < (transform.position.x - StageManagerSC._LumiaInst.transform.position.x) * _Dir2)
        {
            yield return(null);
        }
        _LSC._AutoWalk = 0;
        LumiaHitboxSC _LHBSC = _LSC._Hitbox.GetComponent <LumiaHitboxSC>();

        _LHBSC._HP_Current = _LHBSC._HP_Max;
        _LSC._Canvas.GetComponent <PauseSC>()._UpdateCurrentHp();
        _LSC._SavedScene = SceneManager.GetActiveScene().name;
        SysSaveSC._CharSave();
        StartCoroutine(StageManagerSC._LumiaInst.GetComponent <Lumia_SC>()._WhiteFlash());
        StageManagerSC._LumiaInst.GetComponent <SpriteRenderer>().flipX = false;
        StageManagerSC._LumiaInst.GetComponent <Animator>().SetBool("_Sitting", true);
        StageManagerSC._LSC._TemporaryFlag.Clear();

        yield return(new WaitForSeconds(1f));

        _CanStand = true;
    }
Ejemplo n.º 2
0
    IEnumerator _ShowMenu()
    {
        Debug.Log("타이틀 코루틴 시작");
        SysSaveSC._Loading = true;
        SysSaveSC._SysLoad();
        while (SysSaveSC._Loading == true)
        {
            yield return(null);
        }
        _Menu.SetActive(true);
        Debug.Log("시스템 세이브 불러오기 종료");
        AsyncOperation op = null;

        if (SysSaveSC._LastFile == 0)
        {
            op = SceneManager.LoadSceneAsync("OpeningStage");
        }
        else if (SysSaveSC._LastFile != 0)
        {
            op = SceneManager.LoadSceneAsync("123");
        }
        op.allowSceneActivation = false;
        while (op.progress < 0.9f)
        {
            yield return(null);
        }
        op.allowSceneActivation = true;
        yield return(new WaitForSeconds(1.0f));

        _BlackStart._FadeOut();
    }
Ejemplo n.º 3
0
    IEnumerator _DeathEvent()
    {
        _DeathAniPlayed = true;
        _ANI.SetBool("_Spiked", true);
        _RB.bodyType = RigidbodyType2D.Static;
        GetComponent <AudioSource>().Stop();
        _AS.PlayOneShot(_SFX[1], SysSaveSC._Vol_Master * SysSaveSC._Vol_SFX * 0.01f);
        _AS.PlayOneShot(_SFX[2], SysSaveSC._Vol_Master * SysSaveSC._Vol_SFX * 0.01f);
        GameObject _DeathImpactInst;

        _DeathImpactInst = Instantiate(_DeathImpact);
        _DeathImpactInst.transform.position = transform.position;
        yield return(new WaitForSeconds(0.3f));

        _DeathImpactInst.GetComponent <ParticleSystem>().Play();
        StageManagerSC._CamSC._CoolDownLock = true;
        StageManagerSC._CamSC._Shake(0.5f);
        yield return(new WaitForSeconds(0.2f));

        _FadeObj.SetActive(true);
        while (_FadeObj.GetComponent <CanvasGroup>().alpha < 1f)
        {
            yield return(null);
        }
        _DeathImpactInst.GetComponent <ParticleSystem>().Stop();
        StageManagerSC._CamSC._CoolDownLock = false;
        yield return(new WaitForSeconds(1f));

        _LumiaSC._SwordList.Clear();
        _LumiaSC._SwordDistanceList.Clear();
        _LumiaSC._SwordStock = _LumiaSC._SwordMax;
        AsyncOperation op = SceneManager.LoadSceneAsync(_LumiaSC._SavedScene);

        op.allowSceneActivation = false;
        DontDestroyOnLoad(transform.parent);
        while (op.progress < 0.9f)
        {
            yield return(null);
        }
        op.allowSceneActivation = true;
        GetComponent <AudioSource>().Play();
        _HP_Current = _HP_Max;
        _Canvas.GetComponent <PauseSC>()._UpdateCurrentHp();
        _LumiaSC._SwordStock = _LumiaSC._SwordMax;
        _Canvas.GetComponent <PauseSC>()._UpdateSwordCurrent();
        _ANI.SetBool("_Spiked", false);
        _ANI.SetTrigger("_AfterSpike");
        _RB.bodyType = RigidbodyType2D.Dynamic;
        StageManagerSC._LSC._ChairRespawn = true;
        SysSaveSC._CharSave();
    }
Ejemplo n.º 4
0
 void Start()
 {
     _CheckExist = File.Exists(Application.persistentDataPath + "/CharSave" + _FileNumber + ".dat");
     Debug.Log("Directory:" + Application.persistentDataPath);
     if (_CheckExist == false)
     {
         Debug.Log(_FileNumber + "번 파일이 없습니다");
         _Button.text = _NewGameLang[SysSaveSC._Language];
     }
     else
     {
         Debug.Log(_FileNumber + "번 파일이 발견되었습니다.");
         SysSaveSC._CharLoad(_FileNumber, GetComponent <LoadButtonSC>());
     }
 }
Ejemplo n.º 5
0
 public void _ClosePause()
 {
     _IsPaused = false;
     _DarkScreen(false);
     if (_MenuPages[1].activeSelf == true || _MenuPages[2].activeSelf == true)
     {
         SysSaveSC._SysSave();
         if (_MenuPages[3].activeSelf == true)
         {
             _MenuPages[3].GetComponent <KeySettingSC>()._Waiting = false;
         }
     }
     for (int i = 0; i < 2; i++)
     {
         if (_MenuPages[i].activeSelf == true)
         {
             _MenuPages[i].GetComponent <UIFaderSC>()._FadeOut();
         }
     }
     Time.timeScale = 1f;
     Cursor.visible = false;
 }
Ejemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        _MapOffsetNow = _MapOffset;
        _WorkingCam   = gameObject;
        if (_GenerateAtStart == true && _LumiaInst == null)
        {
            Debug.Log("루미아 생성");
            //필수 Instantiate 생성
            _LumiaInst = Instantiate(_LumiaPrefab);
            _LSC       = _LumiaInst.GetComponent <Lumia_SC>();
            GameObject _TargetMark = Instantiate(_TargetMarkPrefab);
            _CanvasInst = Instantiate(_CanvasPrefab);

            //주인공 캐싱
            _LSC._TargetMark = _TargetMark;
            _LSC._Canvas     = _CanvasInst;
            LumiaHitboxSC _LHBSC = _LSC._Hitbox.GetComponent <LumiaHitboxSC>();
            _LHBSC._Canvas  = _CanvasInst;
            _LHBSC._FadeObj = _CanvasInst.GetComponent <PauseSC>()._FadeObj;


            //저장된 능력치 로드
            if (SysSaveSC._Load_Required == true)
            {
                SysSaveSC._Load_Required = false;
                _LHBSC._HP_Max           = SysSaveSC._Loaded_HP_Max;
                _LHBSC._HP_Current       = SysSaveSC._Loaded_HP_Max;
                _LSC._SavedScene         = SysSaveSC._Loaded_SavedScene;
                _LSC._FileNumber         = SysSaveSC._Loaded_FileNumber;
                _LSC._PlayTime           = SysSaveSC._Loaded_PlayTime;
                _LSC._SwordMax           = SysSaveSC._Loaded_SwordMax;
                _LSC._SwordStock         = SysSaveSC._Loaded_SwordMax;
                _LSC._Money         = SysSaveSC._Loaded_Money;
                _LSC._HaveVessel    = SysSaveSC._Loaded_HaveVessel;
                _LSC._SlashAtkLv    = SysSaveSC._Loaded_SlashAtkLv;
                _LSC._ShotAtkLv     = SysSaveSC._Loaded_ShotAtkLv;
                _LSC._AtkSpeedLv    = SysSaveSC._Loaded_AtkSpeedLv;
                _LSC._WarpLv        = SysSaveSC._Loaded_WarpLv;
                _LSC._SwordSizeLv   = SysSaveSC._Loaded_SwordSizeLv;
                _LSC._PermanentFlag = SysSaveSC._Loaded_PermanentFlag;
            }

            //의자 존재여부 확인
            if (_Chair != null && _Chair.activeSelf == true)
            {
                _ChairStart();
            }
            else if (_StartPos != Vector2.zero)
            {
                _LumiaInst.transform.position = _StartPos;
            }

            //시스템 설정 불러오기
            SysSaveSC._SysLoad();
        }

        //스테이지 초기화
        if (_LumiaInst != null)
        {
            if (_LSC == null)
            {
                _LSC = _LumiaInst.GetComponent <Lumia_SC>();
            }
            _LSC._MyCamera   = gameObject;
            _CamSC           = _LumiaInst.GetComponent <LumiaCamSC>();
            _CamSC._MyCamera = gameObject;
            _LSC._WhenSceneLoad();
            _CamSC._CameraControl();
            transform.position = _LumiaInst.GetComponent <LumiaCamSC>()._CamPos1;
        }
    }
Ejemplo n.º 7
0
 public void ConfirmSet()
 {
     SysSaveSC._SysSave();
 }