public void loadInfo(_StageInformation _stageInfo) { index = -1; isFull = false; this._stageInfo = _stageInfo; DOTween.Init(); setSlots(); checkTargetSlot(); }
void Awake() { AccountID = GameObject.Find("AccountID_DontDestroy").GetComponent <AccountID>().theID; if (passData == null) { passData = this; } else if (passData != this) { Destroy(gameObject); } DontDestroyOnLoad(transform.gameObject); //stageInfo = GameObject.Find("PassStageInfoBetweenScenes_dontDestroy").GetComponent<StageInformation>(); stageInfo = this.gameObject.GetComponent <_StageInformation>(); }
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(); }
public void loadCharacterIDsFromJson() { /* * TextAsset JData = Resources.Load("여기에는 캐릭터 픽 창에서 선택한 3?명의 캐릭터 ID") as TextAsset; * string jdata = JData.text; * //string jdata = File.ReadAllText(Application.dataPath + "/Resources/CodeEditor/ActionData.json"); * //byte[] bytes = System.Convert.FromBase64String(jdata); * //string reformat = System.Text.Encoding.UTF8.GetString(bytes); // this is the actual string * //actionList = JsonConvert.DeserializeObject<List<Action_CodeModifier>>(reformat); * characterIDsList = JsonConvert.DeserializeObject<List<SelectedCharacterIDs>>(jdata); * * //load on scene */ stageInfo = GameObject.Find("PassStageInfoBetweenScenes_dontDestroy").GetComponent <_StageInformation>(); for (int i = 0; i < stageInfo.enemyIds.Count; i++) { characterIDsList.Add(new SelectedCharacterIDs(stageInfo.enemyIds[i])); } print("ID created!"); }
public void showAward() { stageInfo = GameObject.Find("PassStageInfoBetweenScenes_dontDestroy").GetComponent <_StageInformation>(); int stageID = stageInfo.stageID; award_1 = awardPage_3.transform.GetChild(1).gameObject; award_2 = awardPage_3.transform.GetChild(2).gameObject; award_3 = awardPage_3.transform.GetChild(3).gameObject; award_4 = awardPage_3.transform.GetChild(4).gameObject; award_5 = awardPage_3.transform.GetChild(5).gameObject; award_6 = awardPage_3.transform.GetChild(6).gameObject; if (stageID == 0) { //조건 한개, 아이템 한개 를 주자. this.transform.GetComponent <CreateAwards>().randomizeAward_Condition(stageID, award_1); this.transform.GetComponent <CreateAwards>().randomizeAward_Item(stageID, award_2); award_3.SetActive(false); award_4.SetActive(false); award_5.SetActive(false); award_6.SetActive(false); } else if (stageID == 1) { this.transform.GetComponent <CreateAwards>().randomizeAward_Condition(stageID, award_1); this.transform.GetComponent <CreateAwards>().randomizeAward_Item(stageID, award_2); award_3.SetActive(false); award_4.SetActive(false); award_5.SetActive(false); award_6.SetActive(false); } else if (stageID == 2) { this.transform.GetComponent <CreateAwards>().randomizeAward_Condition(stageID, award_1); this.transform.GetComponent <CreateAwards>().randomizeAward_Item(stageID, award_2); this.transform.GetComponent <CreateAwards>().randomizeAward_Item(stageID, award_3); award_4.SetActive(false); award_5.SetActive(false); award_6.SetActive(false); } //1-1 보상은 1. 액션-앞으로가기 2.조건-적이 0명 이하 //1-2 보상은 1. 액션-포션사용 2.조건-HP가20%이하 3.아이템-포션 /* * if(stageInfo.stageLevel == 1) * { * award_1.transform.GetChild(0).GetComponent<Image>().sprite = Resources.Load<Sprite>("CodeEditor/Action3"); * award_1.transform.GetChild(1).GetComponent<Text>().text = "액션- 적을 향해 앞으로 이동"; * * award_2.transform.GetChild(0).GetComponent<Image>().sprite = Resources.Load<Sprite>("CodeEditor/Condition6"); * award_2.transform.GetChild(1).GetComponent<Text>().text = "조건- 적이 0명 이하"; * * award_3.SetActive(false); * award_4.SetActive(false); * award_5.SetActive(false); * award_6.SetActive(false); * } * else if(stageInfo.stageLevel == 2) * { * award_1.transform.GetChild(0).GetComponent<Image>().sprite = Resources.Load<Sprite>("CodeEditor/Action2"); * award_1.transform.GetChild(1).GetComponent<Text>().text = "액션- 포션 사용"; * * award_2.transform.GetChild(0).GetComponent<Image>().sprite = Resources.Load<Sprite>("CodeEditor/Condition1"); * award_2.transform.GetChild(1).GetComponent<Text>().text = "조건- HP가 20% 이하"; * * award_3.transform.GetChild(0).GetComponent<Image>().sprite = Resources.Load<Sprite>("ItemDB/Potion/0"); * award_3.transform.GetChild(1).GetComponent<Text>().text = "포션 +30"; * * award_4.SetActive(false); * award_5.SetActive(false); * award_6.SetActive(false); * } */ }