public void upMap() { setting = 4; cubeok_new ak = new cubeok_new(row, col, state, 0, 0); count = ak.start(); if (count < 200) { afterSave = GameObject.Find("Canvas").transform.FindChild("setName"); } else { afterSave = GameObject.Find("Canvas").transform.FindChild("notSave"); } afterSave.gameObject.SetActive(true); }
void OnCollisionEnter2D(Collision2D collision) { PlayerPrefs.SetInt("clear_o", 1); PlayerPrefs.SetInt("conllsion", 1); clearUI.SetActive(true); if (PlayerPrefs.HasKey("num")) { n = PlayerPrefs.GetInt("num"); } else { n = 0; } if (PlayerPrefs.HasKey("stageNum")) { stagenum = PlayerPrefs.GetInt("stageNum"); } else { stagenum = 0; } if (stagenum >= n && stagenum != 30) { n = stagenum + 1; PlayerPrefs.SetInt("num", n); } cubeok_new ak2 = new cubeok_new(row, col, state, starting_x, starting_y); int s_min = ak2.start(); // 해당 맵의 최소 이동 횟수 int m_count = PlayerPrefs.GetInt("m_count"); // 움직인 횟수 float check_move = 0; Debug.Log(m_count.ToString()); double star = m_count - s_min; int b_star = 0; if (PlayerPrefs.HasKey("star" + stagenum)) { b_star = PlayerPrefs.GetInt("star" + stagenum); } if (star <= 0) { PlayerPrefs.SetInt("star" + stagenum, 3); } else { star = m_count * 1.2 - s_min; if (star <= 0) { PlayerPrefs.SetInt("star" + stagenum, 2); } else { PlayerPrefs.SetInt("star" + stagenum, 1); } } int starn = 0; if (PlayerPrefs.HasKey("star" + stagenum)) { starn = starn = PlayerPrefs.GetInt("star" + stagenum); } stars a = new stars(star_group, star1, star2, star3); a.vv(); if (b_star > starn) { PlayerPrefs.SetInt("star" + stagenum, b_star); } }