Example #1
0
        public void EditorIsDone()  //에디터 저장후 씬 로드 해버림.
        {
            //리스트 바로 저장하고 씬로드해주기(메인화면으로?)
            ReadyForSaving();

            //스테이지 저장.
            StageDataMgr.GetInstance().SaveData(EditSTList, StageManager.fileNameForEdit);

            SceneManager.LoadScene(Constants.stageSelectSceneName);
        }
Example #2
0
    // stageData-n.json을 처음 만들때 사용하는 함수입니다.
    // 개발 기간에만 사용할 함수입니다.
    public void MakeStageDataJSON()
    {
        StageData stageData = new StageData();

        string JsonData = JsonUtility.ToJson(stageData, true);
        string path     = StageDataMgr.GetPathFromSaveFile();

        using (FileStream stream = File.Open(path, FileMode.Create))
        {
            byte[] byteData = Encoding.UTF8.GetBytes(JsonData);

            stream.Write(byteData, 0, byteData.Length);

            stream.Close();

            Debug.Log("EnemySpawnMgr: Single StageData MAKE COMPLETE \n" + path);
        }
    }
Example #3
0
    public void LoadStageDataNInit(int idx)
    {
        currTime     = 0f;
        currSpawnIdx = 0;

        stageData = StageDataMgr.LoadSingleStageData(idx);

        normalWaveTime = stageData.normalTime;
        bigWaveTime    = stageData.bigPatternTime;
        stageData.spawnDatasInNormal.Sort((a, b) => (a.spawnTime.CompareTo(b.spawnTime)));
        stageData.bigPattern.Sort((a, b) => (a.spawnTime.CompareTo(b.spawnTime)));


        stageTimeBar  = FindObjectOfType <StageTimeBar>();
        stageTimeText = FindObjectOfType <StageTimeText>();

        stageTimeBar.SetBigWaveFlag(normalWaveTime / (normalWaveTime + bigWaveTime));
        float ratio = currTime / (normalWaveTime + bigWaveTime);

        stageTimeBar.SetTimeBar(ratio);
    }
Example #4
0
        void Start()
        {
            if (StageManager.fileNameForEdit == null)
            {
                ErrorManager.SpurtError("파일 이름이 없음!");
            }
            List <StageEditorST> list =
                StageDataMgr.GetInstance().CheckTheStage(StageManager.fileNameForEdit);

            EditSTList = new List <StageEditorST>();

            for (int i = 0; i < list.Count; i++)
            {
                StageEditorST sest = new StageEditorST(list[i].pos, list[i].whichTurn, list[i].soa);
                EditSTList.Add(sest);
            }


            MapObjPoolingGeneration();
            StartCoroutine(BringToWorkspace());

            ClearAndShowChunks();
        }
Example #5
0
    public void OnClickEdit(Button btn)
    {
        int StageNum = int.Parse(btn.GetComponentInChildren <Text>().text);

        StageManager.stageNum = E_STAGE.NONE;
        switch (StageNum)
        {
        case 1:
            StageManager.fileNameForEdit = Constants.editStage_1_fileName;
            break;

        case 2:
            StageManager.fileNameForEdit = Constants.editStage_2_fileName;
            break;

        case 3:
            StageManager.fileNameForEdit = Constants.editStage_3_fileName;
            break;

        case 4:
            StageManager.fileNameForEdit = Constants.editStage_4_fileName;
            break;

        case 5:
            StageManager.fileNameForEdit = Constants.editStage_5_fileName;
            break;

        case 6:
            StageManager.fileNameForEdit = Constants.editStage_6_fileName;
            break;

        case 7:
            StageManager.fileNameForEdit = Constants.editStage_7_fileName;
            break;

        case 8:
            StageManager.fileNameForEdit = Constants.editStage_8_fileName;
            break;

        case 9:
            StageManager.fileNameForEdit = Constants.editStage_9_fileName;
            break;

        case 10:
            StageManager.fileNameForEdit = Constants.editStage_10_fileName;
            break;

        case 11:
            StageManager.fileNameForEdit = Constants.editStage_11_fileName;
            break;

        case 12:
            StageManager.fileNameForEdit = Constants.editStage_12_fileName;
            break;

        case 13:
            StageManager.fileNameForEdit = Constants.editStage_13_fileName;
            break;

        case 14:
            StageManager.fileNameForEdit = Constants.editStage_14_fileName;
            break;

        case 15:
            StageManager.fileNameForEdit = Constants.editStage_15_fileName;
            break;

        case 16:
            StageManager.fileNameForEdit = Constants.editStage_16_fileName;
            break;
        }
        if (StageDataMgr.IsFileExist(StageManager.fileNameForEdit))
        {
            EditMenu.transform.GetChild(0).gameObject.SetActive(false);
            EditMenu.transform.GetChild(1).gameObject.SetActive(true);
            EditMenu.transform.GetChild(2).gameObject.SetActive(true);
        }
        else
        {
            EditMenu.transform.GetChild(0).gameObject.SetActive(true);
            EditMenu.transform.GetChild(1).gameObject.SetActive(false);
            EditMenu.transform.GetChild(2).gameObject.SetActive(false);
        }
    }
Example #6
0
File: test.cs Project: solhwi/Queen
 public void MakeStageData()
 {
     StageDataMgr.MakeSingleEmptyStageData();
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     editedList = StageDataMgr.GetInstance().LoadData(StageManager.fileNameForEdit);
     EditedStageMaking();
 }