void Start() { DSF = GameObject.Find("Game_Data").GetComponent <Data_Save_Function>(); dino_crush_check = GameObject.Find("Dino").GetComponent <Dino_Making>(); obj_move_support = GameObject.Find("for_move_object"); obj_move_support.SetActive(false); select_ui = GameObject.Find("3ui_set"); select_ui.SetActive(select_ui_state); select_before[0] = GameObject.Find("place_object"); select_before[1] = GameObject.Find("place_object2"); select_before[2] = GameObject.Find("splace_object"); select_before[3] = GameObject.Find("splace_object2"); select_before[4] = GameObject.Find("tplace_object"); select_before[5] = GameObject.Find("tplace_object2"); select_done_ = GameObject.Find("place_done_object"); menu_ui = GameObject.Find("Canvas").GetComponent <UI_Touch>(); if (DSF.placement_number != 0) { all_child_count = select_before[0].transform.childCount + select_before[1].transform.childCount + select_before[2].transform.childCount + select_before[3].transform.childCount + select_before[4].transform.childCount + select_before[5].transform.childCount + select_done_.transform.childCount; //+1하는 이유는 00번이 아니라 01번부터 시작해서 갯수로 따지면 1개가 더 많아야하기 떄문 for (; all_placement_number < all_child_count + 1; all_placement_number++) { //모든 가구 이름 확인(카테고리1) find_all_data = string.Format("fobject_{0:D2}", all_placement_number); //모든 가구 중에서 배치완료(int값이 1임)된것만 정보 가져옴 if (PlayerPrefs.GetInt(find_all_data + string.Format("state")) == 1) { DSF.GetPosRot(find_all_data); } find_all_data2 = string.Format("sobject_{0:D2}", all_placement_number); if (PlayerPrefs.GetInt(find_all_data2 + string.Format("state")) == 1) { DSF.GetPosRot(find_all_data2); } find_all_data3 = string.Format("tobject_{0:D2}", all_placement_number); if (PlayerPrefs.GetInt(find_all_data3 + string.Format("state")) == 1) { DSF.GetPosRot(find_all_data3); } } } if (PlayerPrefs.HasKey("Dino")) { DSF.GetPosRot("Dino"); } //사운드 tui_done = GameObject.Find("done_sound"); //이펙트 placement_particle = GameObject.Find("food_buy_boom"); }
void Start() { about_money = GameObject.Find("Canvas").GetComponent <State_Bar>(); eat = GameObject.Find("food_silder").GetComponent <Slider>(); //배고픔 if (PlayerPrefs.HasKey("state_my_eat")) { eat.value = PlayerPrefs.GetFloat("state_my_eat"); } //한번도 실행시킨적 없으면 0.5f로 초기화 else { eat.value = 0.5f; } food_buy_done_sound = GameObject.Find("food_buy_done_sound"); food_buy_fail_sound = GameObject.Find("food_buy_fail_sound"); food_text = GameObject.Find("food_img_txt"); food_text.SetActive(false); food_left_arrow = GameObject.Find("food_arrow_left"); food_right_arrow = GameObject.Find("food_arrow_right"); food_left_arrow.SetActive(false); food_right_arrow.SetActive(false); for (int i = 0; i < 5; i++) { food_image[i] = GameObject.Find("food_img_" + string.Format("{0:D2}", i)); food_image[i].SetActive(false); //음식갯수 초기화 if (!PlayerPrefs.HasKey("food_number_" + string.Format("{0:D2}", i))) { food_object_number[i] = 3; } else { food_object_number[i] = PlayerPrefs.GetInt("food_number_" + string.Format("{0:D2}", i)); } //음식가격 food_image_price[i] = GameObject.Find("food_" + string.Format("{0:D2}", i) + "_price"); food_image_price[i].SetActive(false); } food_object[0] = GameObject.Find("ChickenLeg"); food_object[1] = GameObject.Find("Cheese"); food_object[2] = GameObject.Find("Croissant"); food_object[3] = GameObject.Find("Fish"); food_object[4] = GameObject.Find("Meat"); uit = GameObject.Find("Canvas").GetComponent <UI_Touch>(); dino_m = GameObject.Find("Dino").GetComponent <Dino_Making>(); dino_object = GameObject.Find("Dino"); Dino = GameObject.Find("Dino").GetComponent <Animator>(); food_buy_ui = GameObject.Find("food_buy_things"); food_buy_ui.SetActive(false); for (int i = 0; i < 10; i++) { food_buy_number[i] = GameObject.Find("food_buy_number_" + string.Format("{0:D2}", i)); food_buy_number[i].SetActive(false); } food_buy_particle = GameObject.Find("food_buy_boom"); food_buy_particle.GetComponent <ParticleSystem>().Stop(); food_buy_particle.GetComponent <AudioSource>().Stop(); }