Пример #1
0
    private void CanOpen()
    {
        if (openActivated)
        {
            if (hitInfo.transform != null)
            {
                // - 선택슬롯에 아무것도 없을때 (열쇠꽂기실패)
                if (theInventory.IsVoid_Slot(selectSlot_script.get_index()))
                {
                    //실패 사운드 @

                    return;
                }

                // - 선택슬롯에 무언가 있을때
                int select_itemCode = theInventory.get_ItemCode(selectSlot_script.get_index());
                //Debug.Log(select_itemCode.ToString());

                // - 선택슬롯으로 열쇠를 가리키면 (성공)
                if (select_itemCode == 40)
                {
                    // - 쪽지매니저 호출
                    notemager.OpenCondition();

                    // - 영상틀기 (O)
                    //loadEnding_script.InStartFadeAnim(); //쪽지매니저와 합치기

                    //Aim.SetActive(false);
                }
                else
                {
                    // - (실패)
                    //실패 사운드 @
                }
            }
        }
    }
Пример #2
0
    private void CanPickUp()
    {
        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                if (hitInfo.transform.CompareTag("Item"))
                {
                    int hit_itemCode = hitInfo.transform.GetComponent <ItemPickUp>().item.itemCode;

                    // - 습득
                    if (hit_itemCode == 110) //퍼즐조각 일때
                    {
                        //Debug.Log(hitInfo.transform.GetComponent<ItemPickUp>().item.itemName + "획득했습니다");
                        Item hit_item = hitInfo.transform.GetComponent <ItemPickUp>().item;

                        //퍼즐조각 입수 사운드
                        SoundManger.instance.PlaySound(itemgainsound);


                        // - 퍼즐조각 수집 개수 증가
                        BlockCount++;
                        if (BlockCount == 1)
                        {
                            //guideController_script.change_sprite(1);
                            //guide_script.InStartFadeAnim();
                        }
                        else
                        {
                            guideController_script.change_sprite(3);
                            guide_script.InStartFadeAnim();
                        }

                        // - 퍼즐조각 습득
                        theInventory.AcquireItem(hit_item);

                        // - 외곽선 없애기
                        hitInfo.transform.gameObject.SetActive(false);
                        OutlineController.set_enabled(pre_ol_index, false);
                        //OutlineController.set_destroy(pre_ol_index); //필요없을수도

                        // - info 사라짐
                        InfoDisappear();
                    }

                    // - 사용
                    else if (hit_itemCode == 111) //조각 배치
                    {
                        if (theInventory.IsVoid_Slot(selectSlot_script.get_index()))
                        {
                            //// - 텍스트 출력
                            //puzzleText.text = "퍼즐조각이 필요하다";
                            ////페이드아웃
                            //text_script.InStartFadeAnim();

                            guideController_script.change_sprite(2);
                            guide_script.InStartFadeAnim();

                            return;
                        }

                        int select_itemCode = theInventory.get_ItemCode(selectSlot_script.get_index());

                        // - 퍼즐 배치
                        if (select_itemCode == 110)
                        {
                            //퍼즐조각 배치 사운드
                            SoundManger.instance.PlaySound(itemusesound);

                            //// - 텍스트 출력
                            //puzzleText.text = "퍼즐조각을 배치했다";
                            ////페이드아웃
                            //text_script.InStartFadeAnim();

                            guideController_script.change_sprite(4);
                            guide_script.InStartFadeAnim();

                            UseCount++;

                            // - 사용
                            Item selectItem = theInventory.get_ItemInfo(selectSlot_script.get_index());
                            theInventory.RemoveSlot(selectItem);
                            if (UseCount == 1)
                            {
                            }
                            else if (UseCount >= 5)
                            {
                                // - 퍼즐조각을 다 모았을때, 퍼즐 클릭가능한 상태가 된다
                                PuzzleOn = true;

                                // - info

                                // - 외곽선 , 빈퍼즐블럭 비활성화
                                hitInfo.transform.gameObject.SetActive(false);
                                OutlineController.set_enabled(pre_ol_index, false);
                                puzzleKey.gameObject.SetActive(true);
                            }
                        }
                        else
                        {
                            //// - 텍스트 출력
                            //puzzleText.text = "퍼즐조각이 필요하다";
                            ////페이드아웃
                            //text_script.InStartFadeAnim();

                            guideController_script.change_sprite(2);
                            guide_script.InStartFadeAnim();
                        }
                    }
                    else if (hit_itemCode == 112) //퍼즐 완
                    {
                        // - 카메라 이동
                        ChangeCam_script.change_Camera(1);

                        // - 스크립트 on
                        CarPuzzle_script.enabled = true;

                        // - info 없애기
                        InfoDisappear();
                        //text_script.stop_coroutine();
                        guide_script.stop_coroutine();
                    }
                    //if (hit_itemCode == 113) //상자 일때
                    //{
                    //    // - 콜라이더 비활성화
                    //    hitInfo.collider.enabled = false;

                    //    // - 외곽선 없애기
                    //    //hitInfo.transform.gameObject.SetActive(false);
                    //    OutlineController.set_enabled(pre_ol_index, false);

                    //    // - info 없애기
                    //    InfoDisappear();

                    //    // - 상자 애니메이션
                    //    boxOpen_script.set_aniBool();
                    //}

                    return;
                }
            }

            if (hitInfo.transform.CompareTag("Note_BP"))
            {
                // - 쪽지 상태
                hitInfo.transform.GetComponent <PageNote>().CheckAddcount(1);
                note_num_script.SetNoteCount();

                // - 팝업 상태
                popupNote = true;

                viewNote_script.StartAni_Note();

                InfoDisappear();
                OutlineController.set_enabled(pre_ol_index, false);

                return;
            }

            if (hitInfo.transform.CompareTag("ObjAni"))
            {
                //애니메이션 출력 전 이동
                InteractionMoving interactMoving_script = hitInfo.transform.GetComponent <InteractionMoving>();
                interactMoving_script.StartToMove();

                InfoDisappear();

                return;
            }
        }
    }
Пример #3
0
    //
    private void Check_use_Item()
    {
        //if (dollAniManager_script.ClickButton())
        //    return;

        if (!layActivated)
        {
            return;
        }

        if (hitInfo2.transform != null)
        {
            if (hitInfo2.transform.CompareTag("Location")) //compare @
            {
                // - 인형들 애니메이션 검사
                //if (!dollAniManager_script.ClickButton()) //클릭이 가능한지
                //    return;

                // - 클릭한 장식장 위치의 스크립트 얻기
                DisplayLocation location_script = hitInfo2.transform.GetComponent <DisplayLocation>();

                if (PickUp_state)
                {
                    //아이템 입수 사운드
                    SoundManger.instance.PlaySound(itemgainsound);

                    // 장식장 인형 가질수있으면 가져가기
                    location_script.take_Doll();
                    PickUp_state = false;
                }
                else // - 장식장에 인형 놓기
                {
                    // - 선택슬롯의 인덱스 얻기
                    int use_index = selectSlot_script.get_index();

                    if (!theInventory.IsVoid_Slot(use_index)) //슬롯에 아이템이 있는가? 있으면 IsVoid_Slot반환값이 false
                    {
                        if (location_script.tryToPut_doll())  //장식장 위치에 이미 인형이 있는가? 없으면 true
                        {
                            //아이템 입수 사운드
                            SoundManger.instance.PlaySound(itemgainsound);

                            // - 아이템 활성화

                            // 아이템 코드
                            int doll_itemCode = theInventory.get_ItemCode(use_index);
                            // 장식장 놓을때, 배치퍼즐의 아이템(인형)의 인덱스를 구한다
                            int doll_displayIndex = displayManager_script2.compareItemCode(doll_itemCode); //인형매니저(2배치퍼즐)에서 아이템 인덱스 얻기

                            if (doll_displayIndex != -1)
                            {
                                // - 위에서 구한 인덱스(doll_displayIndex)에 접근, 이동
                                displayManager_script2.MoveSelectedInputArry(
                                    doll_displayIndex,
                                    location_script.get_DisplayPosition(),
                                    location_script.get_DisplayRotation());
                                location_script.lay_Doll();

                                // - 장식장 비교를 위한 변수

                                // 장식장 위치 넘버
                                int display_index = location_script.location_Num;

                                // - 아이템 코드 저장 #
                                displayManager_script2.set_DisplayArry(display_index, doll_itemCode);

                                // - 아이템사용 후, 슬롯 클리어  O
                                theInventory.clear_Slot(use_index);

                                // - 활성화 상태 / 놓여진 상태임을 animation 매니저에 저장
                                dollAniManager_script.set_dollAcitveState(display_index, true);
                            }
                        }
                    }
                }
            }
            else if (hitInfo2.transform.CompareTag("Enter")) //compare @
            {
                // Enter 버튼을 누르고,
                if (dollAniManager_script.ClickButton()) //클릭이 가능한지
                {
                    if (pre_ol_index == -1)
                    {
                        return;
                    }

                    // - 종소리 사운드
                    SoundManger.instance.PlaySound(bellSound);

                    // - 외곽선 해제
                    OutlineController.set_enabled(pre_ol_index, false);
                    pre_ol_index = -1;
                    OutlineController.set_check(false);
                    outline_active = false;

                    // - 클릭버튼 해제
                    actionCaption.SetActive(false);

                    // - 배치퍼즐 장식장에 한개라도 있으면 상태가 false로
                    if (displayManager_script2.get_inputState())
                    {
                        dollAniManager_script.set_clickable(false); //클릭했으니 상태를 클릭못하는 상태로변환
                    }
                    else //장식장에 아무것도 안 놓여짐,비워져있음
                    {
                        return;
                    }

                    if (displayManager_script2.compare_Answer()) // 맞았을때,
                    {
                        doorAnimation.play_doorAni();            //문열리기
                        SoundManger.instance.PlaySound(deskSound);
                        this.enabled = false;

                        getKey_script.enabled = true;
                        //Debug.Log("clear - layout puzzle - 3stage");
                    }
                    else // 틀렸을때
                    {
                        SoundManger.instance.PlaySound(laugh);
                        // - 비웃기 애니메이션
                        dollAniManager_script.MisplaceDolls();
                        //Debug.Log("wrong answer - layout puzzle - 3stage");
                    }
                }
                else
                {
                    // - 클릭불가 사운드
                    //~
                }
            }
        }
        else
        {
            PickUp_state = false;
        }
    }
Пример #4
0
    //
    private void Check_use_Item()
    {
        if (hitInfo2.transform != null)
        {
            if (hitInfo2.transform.CompareTag("Location")) //compare @
            {
                // - 클릭한 장식장 위치의 스크립트 얻기
                DisplayLocation location_script = hitInfo2.transform.GetComponent <DisplayLocation>();

                if (PickUp_state)
                {
                    //인형 배치 사운드
                    SoundManger.instance.PlaySound(itemgainsound);

                    // 장식장 인형 가질수있으면 가져가기
                    location_script.take_Doll();
                    PickUp_state = false;

                    // #
                    //if (!enter_3stage)
                    displayManager_script.count--;
                }
                else
                {
                    // - 선택슬롯의 인덱스 얻기
                    int use_index = selectSlot_script.get_index();

                    if (!theInventory.IsVoid_Slot(use_index)) //슬롯에 아이템이 있는가? 있으면 IsVoid_Slot반환값이 false
                    {
                        if (location_script.tryToPut_doll())  //장식장 위치에 이미 인형이 있는가? 없으면 true
                        {
                            //인형 배치 사운드
                            SoundManger.instance.PlaySound(itemgainsound);

                            // - 아이템 활성화

                            // 아이템 코드
                            int doll_itemCode = theInventory.get_ItemCode(use_index);
                            // 장식장 놓을때, 이동
                            int doll_displayIndex = displayManager_script.compareItemCode(doll_itemCode); //인형매니저(2배치퍼즐)에서 아이템 인덱스 얻기
                            displayManager_script.MoveSelectedInputArry(
                                doll_displayIndex,
                                location_script.get_DisplayPosition(),
                                location_script.get_DisplayRotation());
                            location_script.lay_Doll();

                            // - 장식장 비교를 위한 변수

                            // 장식장 위치 넘버
                            int display_index = location_script.location_Num;

                            // - 아이템 코드 저장 #
                            displayManager_script.set_DisplayArry(display_index, doll_itemCode);

                            // - 아이템사용 후, 슬롯 클리어  O
                            theInventory.clear_Slot(use_index);

                            // - count 증가 #
                            displayManager_script.count++;

                            // - 2스테이지 장식장 배치가 3스테이지로 옮겨짐. 한번만 실행 # (2스테이지 클리어)
                            if (displayManager_script.count == 8)
                            {
                                //2스테이지 배치퍼즐 off
                                displayManager_script.enabled = false;
                                displayManager_script.destroy_colliders();

                                //3스테이지 배치퍼즐 on
                                displayManager_script2.enabled = true;
                                displayManager_script2.init_inputArry(displayManager_script.get_inputArry());
                                displayManager_script2.Create_sameOne();

                                //라이트
                                _lightOn_script.LightOn();

                                //3스테이지 카메라 스크립트 on
                                actionController_3stage_script.enabled = true;

                                enter_3stage = true;

                                //손전등 없어지기 - 손전등 관련 스크립트 가져오기
                                //FlashlightItem.SetActive(false);
                                flash_end.FlashLightEnd(1);

                                //지하실, 2층계단 오픈
                                //tempDoor.SetActive(false); //콜라이더 비활성화
                                //tempStairs.SetActive(false);
                                temp_basement.SetActive(false);

                                // 지하실 열리기(임시) _________
                                //DoorOpen_Basement doorAni = tempStairs.GetComponent<DoorOpen_Basement>();
                                //doorAni.StartDoorAni();
                                lookingBasement_script.enabled = true;

                                //지하실 파티클 오픈
                                Ring_Particle.SetActive(true);

                                //지하실 움직임 끝
                                _cellarManager.MoveStop();

                                //지하실 엿보기 기능 끝
                                //_cellarDoor_script.enabled = false; //트리거로 검사해서 소용 없다
                                _cellarDoor_script.Set2StageEnd();

                                //모닥불
                                Fire_script.FireWallStartSound();

                                if (particleRing.isPlaying)
                                {
                                    particleRing.Play();
                                }

                                //웬디 AI on
                                wendyAI_Script.ClearLayoutPuzzle();
                                wendyAI_Script.colliderChange();

                                // 외곽선 해제
                                if (pre_ol_index != -1)
                                {
                                    //외곽선 해제
                                    OutlineController.set_enabled(pre_ol_index, false);
                                    pre_ol_index = -1;
                                    OutlineController.set_check(false);
                                    outline_active = false;

                                    // - 클릭버튼 해제
                                    actionCaption.SetActive(false);
                                }
                            }
                        }
                    }
                }
            }
        }
        else
        {
            PickUp_state = false;
        }
    }