コード例 #1
0
    void Start()
    {
        dino_arrow_left       = GameObject.Find("dino_arrow_left");
        dino_arrow_right      = GameObject.Find("dino_arrow_right");
        dino_arrow_left_body  = GameObject.Find("dino_arrow_left_body");
        dino_arrow_right_body = GameObject.Find("dino_arrow_right_body");

        gm_dino_eyes  = GameObject.Find("Dino_Face");
        gm_dino_bodys = GameObject.Find("Dino_Body");
        gm_dino_fins  = GameObject.Find("Dino_Back");

        uit           = GameObject.Find("Canvas").GetComponent <UI_Touch>();
        dino_food_one = GameObject.Find("Dino_Food_Object").GetComponent <Dino_Food>();

        ok_button = GameObject.Find("ok_button");
        ok_button.SetActive(false);
        circle_menu = GameObject.Find("circle_menu");

        //얼굴 텍스쳐 불러오기
        for (int i = 0; i < 25; i++)
        {
            dino_eyes[i] = Resources.Load("Dino_Face" + string.Format("{0:D2}", eyes_number_for)) as Texture;
            eyes_number_for++;
        }
        //몸통 텍스쳐 불러오기
        for (int i = 0; i < 25; i++)
        {
            dino_bodys[i] = Resources.Load("Dino_" + string.Format("{0:D2}", bodys_number_for)) as Texture;
            dino_fins[i]  = Resources.Load("Dino_" + string.Format("{0:D2}", bodys_number_for)) as Texture;
            bodys_number_for++;
        }

        //눈 저장확인
        if (!PlayerPrefs.HasKey("Dino_eyes"))
        {
            eyes_number = 23;
        }
        else
        {
            eyes_number = PlayerPrefs.GetInt("Dino_eyes");
            gm_dino_eyes.GetComponent <SkinnedMeshRenderer>().material.mainTexture = dino_eyes[eyes_number];
        }
        //몸통 저장확인
        if (!PlayerPrefs.HasKey("Dino_bodys"))
        {
            bodys_number = 1;
        }
        else
        {
            bodys_number = PlayerPrefs.GetInt("Dino_bodys");
            gm_dino_bodys.GetComponent <SkinnedMeshRenderer>().material.mainTexture = dino_bodys[bodys_number];
            gm_dino_fins.GetComponent <SkinnedMeshRenderer>().material.mainTexture  = dino_fins[bodys_number];
        }

        dino_arrow_left.SetActive(false);
        dino_arrow_right.SetActive(false);
        dino_arrow_left_body.SetActive(false);
        dino_arrow_right_body.SetActive(false);
    }
コード例 #2
0
    void Start()
    {
        camera_rot_pivot = GameObject.Find("camera_rot_pivot");
        uitouch          = GameObject.Find("Canvas").GetComponent <UI_Touch>();

        left_side_wall  = GameObject.Find("left_side").GetComponent <Renderer>();
        right_side_wall = GameObject.Find("right_side").GetComponent <Renderer>();
        back_side_wall  = GameObject.Find("back_side").GetComponent <Renderer>();
    }
コード例 #3
0
    void Start()
    {
        check_mode = GameObject.Find("Canvas").GetComponent <UI_Touch>();

        for (int i = 0; i < 10; i++)
        {
            score_one[i] = GameObject.Find("result_numbers_00").transform.GetChild(i).gameObject;
            score_two[i] = GameObject.Find("result_numbers_01").transform.GetChild(i).gameObject;
            score_th[i]  = GameObject.Find("result_numbers_02").transform.GetChild(i).gameObject;
            score_fo[i]  = GameObject.Find("result_numbers_03").transform.GetChild(i).gameObject;

            score_one[i].SetActive(false);
            score_two[i].SetActive(false);
            score_th[i].SetActive(false);
            score_fo[i].SetActive(false);
        }

        if (!PlayerPrefs.HasKey("dino_money"))
        {
            score_one[0].SetActive(true);
            score_two[0].SetActive(true);
            score_th[0].SetActive(true);
            score_fo[0].SetActive(true);
        }
        if (PlayerPrefs.HasKey("dino_money"))
        {
            total_money = PlayerPrefs.GetInt("dino_money");

            four_number  = total_money / 1000;
            three_number = (total_money % 1000) / 100;
            two_number   = ((total_money % 1000) % 100) / 10;
            one_number   = ((total_money % 1000) % 100) % 10;

            score_one[one_number].SetActive(true);
            score_two[two_number].SetActive(true);
            score_th[three_number].SetActive(true);
            score_fo[four_number].SetActive(true);
        }

        furniture_buy_ui = GameObject.Find("furniture_buy_things");
        furniture_block  = GameObject.Find("furniture_block");

        //시작할때 가구 구매 여부 확인
        if (PlayerPrefs.GetInt(this.gameObject.name) == 1)
        {
            am_i_sale = true;
        }
        else
        {
            am_i_sale = false;
        }

        buy_done = GameObject.Find("furniture_purchase").GetComponent <AudioSource>();
        buy_fail = GameObject.Find("cant_buy_item").GetComponent <AudioSource>();
    }
コード例 #4
0
    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");
    }
コード例 #5
0
    void Start()
    {
        about_mode   = GameObject.Find("Canvas").GetComponent <UI_Touch>();
        check_unlock = GameObject.Find("Canvas").GetComponent <State_Bar>();

        //menu dot
        menu01_dot_all  = GameObject.Find("menu01_page_dot");
        menu01_dot_y[0] = GameObject.Find("page_number1_y");
        menu01_dot_y[1] = GameObject.Find("page_number2_y");
        menu01_dot_y[1].SetActive(false);

        menu_category[0] = GameObject.Find("store_first");
        menu_category[1] = GameObject.Find("store_second");
        menu_category[2] = GameObject.Find("store_third");

        menu_left_arrow  = GameObject.Find("arrow_left");
        menu_right_arrow = GameObject.Find("arrow_right");

        //카테고리
        furniture_menu[0] = GameObject.Find("furniture_menu_01");
        furniture_menu[1] = GameObject.Find("furniture_menu_02");
        furniture_menu[2] = GameObject.Find("furniture_menu_03");

        //카테고리1 가구
        menu_category1_obj[0] = GameObject.Find("place_object");
        menu_category1_obj[1] = GameObject.Find("place_object2");
        //카테고리2 가구
        menu_category2_obj[0] = GameObject.Find("splace_object");
        menu_category2_obj[1] = GameObject.Find("splace_object2");
        //카테고리3 가구
        menu_category3_obj[0] = GameObject.Find("tplace_object");
        menu_category3_obj[1] = GameObject.Find("tplace_object2");

        //카테고리1 페이지
        menu_category1_page[0] = GameObject.Find("page1");
        menu_category1_page[1] = GameObject.Find("page2");
        menu_category1_page[1].SetActive(false);
        //카테고리2 페이지
        menu_category2_page[0] = GameObject.Find("spage1");
        menu_category2_page[1] = GameObject.Find("spage2");
        menu_category2_page[0].SetActive(false);
        menu_category2_page[1].SetActive(false);
        //카테고리3 페이지
        menu_category3_page[0] = GameObject.Find("tpage1");
        menu_category3_page[1] = GameObject.Find("tpage2");
        menu_category3_page[0].SetActive(false);
        menu_category3_page[1].SetActive(false);

        //카테고리1 페이지 잠금
        place_menu_01_page[0] = GameObject.Find("place_menu_page1_lock");
        place_menu_01_page[1] = GameObject.Find("place_menu_page2_lock");
        //place_menu_01_page[1].SetActive(false);
        //카테고리2 페이지 잠금
        place_menu_02_page[0] = GameObject.Find("splace_menu_page1_lock");
        place_menu_02_page[1] = GameObject.Find("splace_menu_page2_lock");
        //place_menu_02_page[0].SetActive(false);
        place_menu_02_page[1].SetActive(false);
        //카테고리2 페이지 잠금
        place_menu_03_page[0] = GameObject.Find("tplace_menu_page1_lock");
        place_menu_03_page[1] = GameObject.Find("tplace_menu_page2_lock");
        //place_menu_03_page[0].SetActive(false);
        place_menu_03_page[1].SetActive(false);
    }
コード例 #6
0
ファイル: Dino_Food.cs プロジェクト: Wareureung/PocketDino
    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();
    }