Beispiel #1
0
 public void setUnlockPanel(JsonAgeStageFormat age)
 {
     _age               = age;
     stageName.text     = age.AgeName;
     announceText.text  = age.AgeName + " 클리어시 보상으로 받을 수 있습니다.";
     emblemImage.sprite = Resources.Load <Sprite>("AgeDB/Emblem/" + age.EmblemSprite);
     emblemName.text    = age.EmblemName;
     charIamge.sprite   = Resources.Load <Sprite>("AgeDB/Character/" + age.CharSprite);
     charName.text      = age.CharName;
     ageInfo.text       = age.AgeInfo;
 }
Beispiel #2
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);
        }