コード例 #1
0
    //Story씬에서 픽한 정보 _StageInformation에 저장
    public void setStoryInfo(StageInformation pickedStage)
    {
        print("??");
        int stageId = pickedStage.stageLevel - 1;

        // StoryMode에서 선택한 스테이지 누적해서 Json으로 저장하기
        stageInfo.stageID    = stageId;
        stageInfo.stageLevel = pickedStage.stageLevel;
        stageInfo.stageInfo  = pickedStage.stageInfo;
        stageInfo.money      = pickedStage.money;
        stageInfo.gem        = pickedStage.gem;
        stageInfo.experience = 1000;  //Json에서 받아오게 해야된다.
        stageInfo.awards     = new List <JsonStageAwardFormat>(pickedStage.awards);
        // 선택한 stage에 따라 enemy도 저장

        stageInfo.enemyNumber = pickedStage.enemyNumber;
        stageInfo.enemyIds    = new List <int>(pickedStage.enemyIds);
        // stageInfo.enemyIds = new List<int>();
        // stageInfo.enemyIds.Add(0);
        // stageInfo.enemyIds.Add(1);
        // stageInfo.enemyIds.Add(2);

        stageInfo.charNumber          = pickedStage.charNumber;
        stageInfo.enemyStatMultiplier = 1.0f;        //stage level에 따라 변동되는 constant
        print("짱느리네");
    }
コード例 #2
0
    //age, story, char씬에서 픽한 내용 인게임에 적용시키도록 Resources>GamePlay>gameStageInfo json으로 저장
    public void savePickedStageInfoAsJson()
    {
        StageInformation stageInfoJson = new StageInformation();

        stageInfoJson.ageID                = stageInfo.ageID;
        stageInfoJson.experience           = stageInfo.experience;
        stageInfoJson.money                = stageInfo.money;
        stageInfoJson.gem                  = stageInfo.gem;
        stageInfoJson.ageName              = stageInfo.ageName;
        stageInfoJson.ageInfo              = stageInfo.ageInfo;
        stageInfoJson.emblemID             = stageInfo.emblemID;
        stageInfoJson.emblemInfo           = stageInfo.emblemInfo;
        stageInfoJson.emblemName           = stageInfo.emblemName;
        stageInfoJson.stageID              = stageInfo.stageID;
        stageInfoJson.stageLevel           = stageInfo.stageLevel;
        stageInfoJson.stageInfo            = stageInfo.stageInfo;
        stageInfoJson.awards               = new List <JsonStageAwardFormat>(stageInfo.awards);
        stageInfoJson.enemyNumber          = stageInfo.enemyNumber;
        stageInfoJson.enemyIds             = stageInfo.enemyIds;
        stageInfoJson.charNumber           = stageInfo.charNumber;
        stageInfoJson.enemyStatMultiplier  = stageInfo.enemyStatMultiplier;
        stageInfoJson.selectedCharacterIDs = new List <int>(stageInfo.selectedCharacterIDs);

        string jsonData = JsonConvert.SerializeObject(stageInfoJson, Formatting.Indented);

        //jsonData = JValue.Parse(jsonData).ToString(Formatting.Indented);
        File.WriteAllText(Application.dataPath + "/Resources/Json_AccountInfo/" + AccountID.ToString() + "/gameStageInfo.json", jsonData);
        AssetDatabase.Refresh();
    }
コード例 #3
0
    void makeAge(StageInformation _stage)
    {
        _stage.ageID      = 0;
        _stage.ageName    = "이상한 나라의 앨리스";
        _stage.ageInfo    = "챕터 1은 이상한 나라의 앨리스입니다.\n붉은 여왕의 분노에 맞서 블러드 루비를 탈환하세요 .\n ";
        _stage.emblemID   = 0;
        _stage.emblemName = "블러드 루비";
        _stage.emblemInfo = "게임 플레이시 카드 병정 1마리 소환 가능";

        List <JsonStageAwardFormat> awards = new List <JsonStageAwardFormat>();
        JsonStageAwardFormat        _award = new JsonStageAwardFormat();

        _award.AwardImage = 0;
        _award.AwardName  = "조건1";
        _award.AwardInfo  = "뫄뫄하는 조건입니다";
        awards.Add(_award);

        _award            = new JsonStageAwardFormat();
        _award.AwardImage = 1;
        _award.AwardName  = "액션1";
        _award.AwardInfo  = "뫄뫄하는 액션입니다";
        awards.Add(_award);

        _award            = new JsonStageAwardFormat();
        _award.AwardImage = 2;
        _award.AwardName  = "아이템1";
        _award.AwardInfo  = "뫄뫄하는 아이템입니다";
        awards.Add(_award);

        _stage.awards = new List <JsonStageAwardFormat>(awards);
    }
コード例 #4
0
        public void setStageInfo(StageInformation pickedStage)
        {
            stageInfo = new StageInformation();
            // AgePick에서 저장한 정보 불러오기
            TextAsset textData    = Resources.Load("Json_AccountInfo/" + AccountID + "/gameStageInfo") as TextAsset;
            string    ageJsonData = textData.text;

            stageInfo = JsonConvert.DeserializeObject <StageInformation>(ageJsonData);

            int stageId = pickedStage.stageLevel - 1;

            // StoryMode에서 선택한 스테이지 누적해서 Json으로 저장하기
            stageInfo.stageID    = stageId;
            stageInfo.stageLevel = pickedStage.stageLevel;
            stageInfo.stageInfo  = pickedStage.stageInfo;
            stageInfo.awards     = new List <JsonStageAwardFormat>(pickedStage.awards);
            // 선택한 stage에 따라 enemy도 저장

            textData = Resources.Load("Json_GameInfo/Age " + stageId + "/StageInfo") as TextAsset;
            string allStageInfo            = textData.text;
            List <StageInformation> stages = JsonConvert.DeserializeObject <List <StageInformation> >(allStageInfo);

            stageInfo.enemyNumber         = stages[stageId].enemyNumber;
            stageInfo.enemyIds            = new List <int>(stages[stageId].enemyIds);
            stageInfo.charNumber          = stages[stageId].charNumber;
            stageInfo.enemyStatMultiplier = 1.0f;        //stage level에 따라 변동되는 constant


            string jsonData = JsonConvert.SerializeObject(stageInfo);

            jsonData = JValue.Parse(jsonData).ToString(Formatting.Indented);
            File.WriteAllText(Application.dataPath + "/Resources/Json_AccountInfo/" + AccountID.ToString() + "/gameStageInfo.json", jsonData);
        }
コード例 #5
0
    public void makeStageJson()
    {
        //스테이지 정보(age + stage) + 맵 level
        //reward 정보: emeblem, rewards
        //enemy 정보: enemy id, enemy num, enemy level

        stages = new List <StageInformation>();
        StageInformation stage = new StageInformation();

        makeAge(stage);
        stage.stageID     = 0;
        stage.stageInfo   = "카드병정 1마리를 물리치세요";
        stage.stageLevel  = 1;
        stage.enemyNumber = 1;
        List <int> enemyIds = new List <int>(new int[] { 0 });

        stage.enemyIds   = new List <int>(enemyIds);
        stage.charNumber = 1;
        stage.money      = 1000;
        stage.gem        = 100;
        stages.Add(stage);

        StageInformation stage1 = new StageInformation();

        makeAge(stage1);
        stage1.stageID     = 1;
        stage1.stageInfo   = "카드병정 1마리를 물리치세요";
        stage1.stageLevel  = 2;
        stage1.enemyNumber = 1;
        enemyIds           = new List <int>(new int[] { 0 });
        stage1.enemyIds    = new List <int>(enemyIds);
        stage1.charNumber  = 1;
        stage1.money       = 1000;
        stage1.gem         = 100;
        stages.Add(stage1);

        StageInformation stage2 = new StageInformation();

        makeAge(stage2);
        stage2.stageID     = 2;
        stage2.stageInfo   = "카드병정 2마리를 물리치세요";
        stage2.stageLevel  = 3;
        stage2.enemyNumber = 2;
        enemyIds           = new List <int>(new int[] { 0, 1 });
        stage2.enemyIds    = new List <int>(enemyIds);
        stage2.charNumber  = 1;
        stage2.money       = 1000;
        stage2.gem         = 100;
        stages.Add(stage2);


        string jdata = JsonConvert.SerializeObject(stages);

        jdata = JValue.Parse(jdata).ToString(Formatting.Indented);
        File.WriteAllText(Application.dataPath + "/Resources/Json_GameInfo/Age0/StageInfo.json", jdata);

        AssetDatabase.Refresh();
    }
コード例 #6
0
 public void gameStart(int level, StageInformation stageInfo)
 {
     print("uimanager entry");
     passData.setStoryInfo(stageInfo);
     UnityEngine.SceneManagement.SceneManager.LoadScene("CharacterPick");
     //UnityEngine.SceneManagement.SceneManager.LoadScene("Resetter");
     //StartCoroutine(LoadAsynchronously("CharacterPick"));
     // sex.allow();
 }
コード例 #7
0
 void Start()
 {
     g_trouble_Script     = GameObject.Find("TroubleObj").GetComponent <TroubleScr>();
     g_result_Script      = GameObject.Find("Stageinformation").GetComponent <ResultScript>();
     g_clear_Script       = GameObject.Find("Game_Controller").GetComponent <Stage_Clear>();
     g_folder_Script      = GameObject.Find("Stageinformation").GetComponent <Folder_Script>();
     g_information_Script = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     g_game_con_Script    = GameObject.Find("Game_Controller").GetComponent <Game_Controller>();
     g_player_Script      = GameObject.Find("Player_Controller").GetComponent <Playercontroller>();
     g_player_anim_Script = this.GetComponent <Player_Animation>();
     g_player_obj         = this.gameObject;
 }
コード例 #8
0
    void Start()
    {
        //ボタンを生むのに必要な情報を取得
        g_json_script            = GameObject.Find("Stageinformation").GetComponent <JsonArray>();
        g_stageInformationScript = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
        g_se_source_Script       = GameObject.Find("SEList").GetComponent <Se_Source>();
        g_spwern_script          = GetComponent <SpwernButton>();
        g_stage_image_Script     = GameObject.Find("Stage_Image").GetComponent <Stage_Image>();
        g_move_counter_Script    = GameObject.Find("Stage_Move_Counter").GetComponent <Select_Move_Counter>();
        //ボタンの幅を取得
        g_move_g_var = g_spwern_script.g_button_y_pos;
        Debug.Log(g_move_g_var);
        //横の数を取得
        g_side_stage_count = g_json_script.g_stage_side;
        //縦の数を取得
        g_page_var_count = g_spwern_script.g_var_size;
        //縦の最大数を取得
        g_max_var_count = g_json_script.g_stage_max_var;
        //生成するステージの数を取得
        g_max_stageelement = g_json_script.g_stage_array_num;
        //1ページのステージの数を計算
        g_stage_page_count = g_side_stage_count * g_page_var_count;
        //全部のページが埋まってた場合
        if (g_max_stageelement % g_stage_page_count == 0)
        {
            //ページ数を計算
            g_page_count    = g_max_stageelement / g_stage_page_count;
            g_var_remainder = g_page_var_count;
        }
        else
        {
            g_page_count = (g_max_stageelement / g_stage_page_count) + 1;
            Debug.Log(g_page_count);

            //最後のページのステージの個数
            g_stage_remainder = g_max_stageelement % g_stage_page_count;
            Debug.Log(g_stage_remainder);

            g_stage_remainder = g_stage_remainder / g_side_stage_count;
            Debug.Log(g_side_stage_count);

            if (g_stage_remainder == 0)
            {
                g_var_remainder = g_stage_remainder + 1;
                Debug.Log(g_var_remainder);
            }
            else
            {
                g_var_remainder = g_stage_remainder + 1;
                Debug.Log(g_var_remainder);
            }
        }
    }
コード例 #9
0
 private void Start()
 {
     g_resultScript           = GameObject.Find("Stageinformation").GetComponent <ResultScript>();
     g_highScoreText          = GameObject.Find("high_move_para");
     g_scoreJsonScript        = GameObject.Find("ScoreInformation").GetComponent <ScoreJsonScript>();
     g_stageInformationScript = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     //前の残りて数が現在の残りて数よりも少なかった場合
     if (g_scoreJsonScript.g_stageScore.g_stageInfo[g_stageInformationScript.Get_StageNum()].g_trouble < g_resultScript.GetRemaining())
     {
         //ハイスコアを変更させる
         g_highScoreText.GetComponent <TextMeshProUGUI>().text = g_resultScript.GetRemaining().ToString();
     }
 }
コード例 #10
0
 void Start()
 {
     #region スクリプトの取得
     g_resultScript           = GameObject.Find(g_stageInfoName).GetComponent <ResultScript>();
     g_jsonArrayScript        = GameObject.Find(g_stageInfoName).GetComponent <JsonArray>();
     g_stageInformationScript = GameObject.Find(g_stageInfoName).GetComponent <StageInformation>();
     g_scoreJsonScript        = GameObject.Find("ScoreInformation").GetComponent <ScoreJsonScript>();
     #endregion
     if (g_scoreJsonScript.g_stageScore.g_stageInfo[g_stageInformationScript.Get_StageNum()].g_evaluation < g_resultScript.Trouble())
     {
         //jsonに数値を入れる
         g_scoreJsonScript.ChangeInfo(g_stageInformationScript.Get_StageNum(), g_resultScript.Trouble(), g_resultScript.GetRemaining());
     }
 }
コード例 #11
0
ファイル: Input_Data.cs プロジェクト: sakurai-desu/DiceGame
    private void Awake()
    {
        g_informatinScript = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
        g_jsonname         = g_informatinScript.g_playStageName;

        string       datastr = "";
        StreamReader reader;

        reader  = new StreamReader(Application.streamingAssetsPath + "/" + g_jsonname);
        datastr = reader.ReadToEnd();
        reader.Close();
        //ステージデータを取り込む
        g_inputJson = JsonUtility.FromJson <InputJson>(datastr);
    }
コード例 #12
0
ファイル: Gameview.cs プロジェクト: matsumoto36/Hasamu2017
    /// <summary>
    /// ゲームをクリアした時に実行される
    /// </summary>
    public static void GameClearView()
    {
        Debug.Log("ゲームクリア");

        GameObject viewPrefab = Resources.Load <GameObject>("Prefabs/[GameClearView]");
        Transform  target     = GameObject.Find("Canvas").transform;

        GameObject viewObject = Instantiate(viewPrefab, target);

        Text t = GameObject.Find("Remaining").GetComponent <Text>();

        t.text = string.Format("LimitTime : {0:0.0}", Timebar.time);

        Button nextStage = GameObject.Find("NextRoom").GetComponent <Button>();

        string s;

        //次のステージを取得
        if (!StageInformation.GetNextFloor(GameManager.stageLevel, GameManager.stageNum, out s))
        {
            //投げればボタンを表示しない
            nextStage.gameObject.SetActive(false);
        }
        else
        {
            //次のステージボタンを押したとき
            nextStage.onClick.AddListener(() => {
                string next;
                //次のステージを取得
                StageInformation.GetNextFloor(GameManager.stageLevel, GameManager.stageNum, out next);

                string[] bff = next.Split('-');
                //情報を格納
                GameManager.SetStageData(int.Parse(bff[0]), int.Parse(bff[1]));

                //移動
                AudioManager.FadeOut(2);
                SumCanvasAnimation.MoveScene("GameScene");
            });
        }

        //ステージセレクトボタンを押したとき
        Button select = GameObject.Find("Stage select").GetComponent <Button>();

        select.onClick.AddListener(() => {
            AudioManager.FadeOut(2);
            SumCanvasAnimation.MoveScene("StageSelectScene");
        });
    }
コード例 #13
0
        protected override void Init()
        {
            this.playerDeathManager      = this.GetComponent <PlayerDeathManager>();
            this.coinScoreManager        = this.GetComponent <CoinScoreManager>();
            this.playerStageClearManager = this.GetComponent <PlayerStageClearManager>();

            if (GameManager.NowStageInformation == null)
            {
                var index       = this.worldData.GetStageIndex(this.stageData.StageId);
                var information = new StageInformation(this.worldData.WorldId, index);
                var request     = new MoveStageRequest(information, this.returnToScene);
                GameManager.ImplyRequest(request);
            }
            this.DataInit(GameManager.NowStageInformation);
        }
コード例 #14
0
 public SimpleKMP()
 {
     StartPositions       = new StartPositions();
     EnemyRoutes          = new EnemyRoutes();
     ItemRoutes           = new ItemRoutes();
     CheckPoints          = new CheckPoints();
     Objects              = new Objects();
     Routes               = new Routes();
     Area                 = new Area();
     Camera               = new Camera();
     RespawnPoints        = new RespawnPoints();
     GliderRoutes         = new GliderRoutes();
     StageInformation     = new StageInformation();
     currentCullingRoutes = new List <int>();
 }
コード例 #15
0
        public SimpleKMP(byte[] data)
        {
            KMP kmp_data;

            kmp_data = new KMP(data);

            StartPositions       = new StartPositions(kmp_data.KartPoint);
            EnemyRoutes          = new EnemyRoutes(kmp_data.EnemyPoint, kmp_data.EnemyPointPath);
            ItemRoutes           = new ItemRoutes(kmp_data.ItemPoint, kmp_data.ItemPointPath);
            CheckPoints          = new CheckPoints(kmp_data.CheckPoint, kmp_data.CheckPointPath);
            Objects              = new Objects(kmp_data.GlobalObject);
            Routes               = new Routes(kmp_data.PointInfo);
            Area                 = new Area(kmp_data.Area);
            Camera               = new Camera(kmp_data.Camera);
            RespawnPoints        = new RespawnPoints(kmp_data.JugemPoint);
            GliderRoutes         = new GliderRoutes(kmp_data.GliderPoint, kmp_data.GliderPointPath);
            StageInformation     = new StageInformation(kmp_data.StageInfo);
            currentCullingRoutes = new List <int>();
        }
コード例 #16
0
        public void setCharacterInfo(int[] selectedCharacterIDs)
        {
            stageInfo = new StageInformation();

            // StoryPick에서 저장한 정보 불러오기
            TextAsset textData = Resources.Load("Json_GameInfo/gameStageInfo") as TextAsset;
            string    jsonData = textData.text;

            stageInfo = JsonConvert.DeserializeObject <StageInformation>(jsonData);

            stageInfo.selectedCharacterIDs = new List <int>();
            for (int i = 0; i < stageInfo.charNumber; i++)
            {
                stageInfo.selectedCharacterIDs.Add(selectedCharacterIDs[i]);
            }

            jsonData = JsonConvert.SerializeObject(stageInfo);
            jsonData = JValue.Parse(jsonData).ToString(Formatting.Indented);
            File.WriteAllText(Application.dataPath + "/Resources/Json_AccountInfo/" + AccountID.ToString() + "/gameStageInfo.json", jsonData);
        }
コード例 #17
0
        //public static saveStageInfo instance;

        // void Awake(){
        //     if(instance == null)
        //         instance = this;
        //     else if(instance != this){
        //         Destroy(gameObject);
        //     }

        // }

        public void setAgeInfo(JsonAgeStageFormat age)
        {
            stageInfo            = new StageInformation();
            stageInfo.ageID      = age.AgeID;
            stageInfo.experience = 1000; //Json에서 받아오게 해야된다.
            stageInfo.money      = 1000; //Json에서 받아오게 해야된다.
            stageInfo.gem        = 2;    //Json에서 받아오게 해야된다.
            stageInfo.ageName    = age.AgeName;
            stageInfo.ageInfo    = age.AgeInfo;
            stageInfo.emblemID   = age.EmblemSprite;
            stageInfo.emblemInfo = age.EmblemInfo;
            stageInfo.emblemName = age.EmblemName;
            Debug.Log("setAgeInfo: " + stageInfo.ageName);

            string jsonData = JsonConvert.SerializeObject(stageInfo);

            jsonData = JValue.Parse(jsonData).ToString(Formatting.Indented);
            // File.WriteAllText(Application.dataPath + "/Scripts/GamePlay/gameStageInfo.json", jsonData);
            File.WriteAllText(Application.dataPath + "/Resources/Json_AccountInfo/" + AccountID.ToString() + "/gameStageInfo.json", jsonData);
        }
コード例 #18
0
        void Awake()
        {
            AccountID = GameObject.Find("AccountID_DontDestroy").GetComponent <AccountID>().theID;

            if (GameObject.Find("PassStageInfoBetweenScenes_dontDestroy") != null)
            {
                print("loadCharInfo find pass");
                passData   = GameObject.Find("PassStageInfoBetweenScenes_dontDestroy").GetComponent <passDataBetweenScene>();
                _stageInfo = passData.GetComponent <_StageInformation>();
            }
            else
            {
                Debug.Log("No dontdestroy");
                TextAsset textData             = Resources.Load("Json_GameInfo/Age0/StageInfo") as TextAsset;
                string    charJsonData         = textData.text;
                List <StageInformation> stages = JsonConvert.DeserializeObject <List <StageInformation> >(charJsonData);
                stageInfo = stages[0];
            }
            loadCharsJson();
            loadEnemyJson();
        }
コード例 #19
0
        public void Show(ViewModel viewModel, string imageKey)
        {
            if (viewModel is null)
            {
                Hide();

                return;
            }

            _disposablesForModel.DisposeAllAndClear();
            SharedViewModel = viewModel;
            SharedViewModel.State.Subscribe(SubscribeState).AddTo(_disposablesForModel);
            SharedViewModel.Selected.Subscribe(SubscribeSelect).AddTo(_disposablesForModel);
            SharedViewModel.HasNotification.SubscribeTo(hasNotificationImage).AddTo(_disposablesForModel);
            Set(SharedViewModel.hasBoss, imageKey);

            if (int.TryParse(SharedViewModel.stageNumber, out var stageId))
            {
                buttonText.text = StageInformation.GetStageIdString(stageId);
            }
        }
コード例 #20
0
 public MoveStageRequest(StageInformation information, SceneObject ReturnToScene)
 {
     this.ReturnToScene    = ReturnToScene;
     this.StageInformation = information;
 }
コード例 #21
0
 //초기화 관련 함수들
 public void BackToStageSelect()
 {
     currentMap        = null;
     _currentStageInfo = null;
 }
コード例 #22
0
 private void Start()
 {
     g_scoreJsonScript        = GameObject.Find("ScoreInformation").GetComponent <ScoreJsonScript>();
     g_stageInformationScript = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     GameObject.Find("Fade_Image").GetComponent <Fade_In_Out>().GameStart_Fade_In();
 }
コード例 #23
0
ファイル: TutorealText.cs プロジェクト: sakurai-desu/DiceGame
 // Start is called before the first frame update
 void Start()
 {
     g_tuto_text   = GetComponent <TextMeshProUGUI>();
     g_info_script = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
 }
コード例 #24
0
ファイル: TaskText.cs プロジェクト: sakurai-desu/DiceGame
 // Start is called before the first frame update
 void Start()
 {
     g_task       = GetComponent <TextMeshProUGUI>();
     g_stage_info = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
 }
コード例 #25
0
 // Start is called before the first frame update
 void Start()
 {
     g_information_script = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     GameObject.Find("Fade_Image").GetComponent <Fade_In_Out>().GameStart_Fade_In();
 }
コード例 #26
0
 // Start is called before the first frame update
 void Start()
 {
     g_informationScript = GameObject.Find("StageInformation").GetComponent <StageInformation>();
 }
コード例 #27
0
 void Start()
 {
     g_info_Script = GetComponent <StageInformation>();
 }
コード例 #28
0
 void Start()
 {
     g_info_Script      = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     g_fade_Script      = GameObject.Find("Fade_Image").GetComponent <Fade_In_Out>();
     g_se_source_Script = GameObject.Find("SEList").GetComponent <Se_Source>();
 }