示例#1
0
 private void CanPickUp()
 {
     if (pickupActivated)
     {
         if (hitInfo.transform != null)
         {
             theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
             Destroy(hitInfo.transform.gameObject);
             InfoDisappear();
         }
     }
 }
 void PickUp()
 {
     if (pickupActivated && hitinfo.transform != null)    //획득가능상태일때
     {
         theInventory.AcquireItem(hitinfo.transform.GetComponent <ItemPickUp>().item);
         Destroy(hitinfo.transform.gameObject);      //옵젝 파괴 및 문구 가리기
         ItemInfoDisappear();
     }
 }
示例#3
0
 void OnTriggerEnter(Collider colider)
 {
     if (colider.gameObject.tag == "Item")
     {
         //포션이 Player라는 이름과 부딫혔다면
         Debug.Log("획득");
         Destroy(colider.gameObject);                                                             // 부딫히면 물체사라짐
         theInventory.AcquireItem(colider.gameObject.transform.GetComponent <ItemPickup>().item); //아이템획득
     }
 }
示例#4
0
 private void Destruction()
 {
     theInven.AcquireItem(item_leaf, leafCount);
     for (int i = 0; i < rigidbodys.Length; i++)
     {
         rigidbodys[i].useGravity = true;
         rigidbodys[i].AddExplosionForce(force, transform.position, 1f);//폭발하는 듯한 효과 (힘,위치,반경)
         boxColliders[i].enabled = true;
     }
     Destroy(this.gameObject, destroyTime);
 }
示例#5
0
 private void CanPickUp()
 {
     if (pickupActivated)
     {
         if (hitInfo.transform != null)
         {
             Debug.Log(hitInfo.transform.GetComponent <ItemPickUp>().item.itemName + " 획득 했습니다.");
             theInventory.AcquireItem((hitInfo.transform.GetComponent <ItemPickUp>().item));
             Destroy(hitInfo.transform.gameObject);
             InfoDisappear();
         }
     }
 }
示例#6
0
    private void CanPickUp()
    {
        if (!outline_active) // 습득과 관련된 아이템은 외곽선과 상관 있다
        {
            return;
        }

        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                if (hitInfo.transform.CompareTag("Item"))
                {
                    if (theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item))
                    {
                        //아이템 입수 사운드
                        SoundManger.instance.PlaySound(itemgainsound);


                        // - 아이템 습득
                        InfoDisappear();                               //info 삭제

                        hitInfo.transform.gameObject.SetActive(false); //아이템 비활성화
                        OutlineController.set_enabled(pre_ol_index, false);
                        OutlineController.set_check(false);
                        outline_active = false;

                        // - 클릭버튼 비활성화
                        actionCaption.SetActive(false);

                        PickUp_state = true; // 습득한 상태로 변경 -> 이후 Check_use_Item에서 location_script의 상태 업데이트하기 위해서

                        // - 장식장 클릭 (장식장에서 인형을 뺐을때)
                        if (hitInfo2.transform != null) //null @
                        {
                            if (hitInfo2.transform.CompareTag("Location"))
                            {
                                DisplayLocation location_script = hitInfo2.transform.GetComponent <DisplayLocation>(); // @
                                int             display_index   = location_script.location_Num;

                                displayManager_script2.reset_DisplayArry(display_index);

                                // - 활성화 상태 / 놓여진 상태임을 animation 매니저에 저장
                                dollAniManager_script.set_dollAcitveState(display_index, false);
                            }
                        }
                    }
                }
            }
        }
    }
示例#7
0
    private void CanPickUp()
    {
        if (pickUpActivated)
        {
            if (hitinfo.transform != null)
            {
                Debug.Log(hitinfo.transform.GetComponent <ItemPick>().item.itemName + " 획득 하였습니다");
                theinventory.AcquireItem(hitinfo.transform.GetComponent <ItemPick>().item);
                //around_start = true;

                hitinfo.transform.gameObject.SetActive(false); // 파괴하지말고 꺼보자
                //Destroy(hitinfo.transform.gameObject); // 습득한 아이템은 파괴


                // 사운드 하나 입히자 습득할때. 빠빠빠빠람 이라던가
                InfoDisappear(); // 정보는 안보이도록 .
            }
        }
    }
示例#8
0
    private void CanPickUp()
    {
        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                Debug.Log(hitInfo.transform.GetComponent <ItemPickUp>().item.itemName + " 획득했습니다");
                theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item); //부딫힌 충돌채의 ItemPickUp에있는 아이템을 인벤토리에 넣어준다.

                //하드코딩
                if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "RawMeat")
                {
                    QuestUI.instance.AddCurrentMeatNumber();
                }
                //하드코딩
                if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "Rock")
                {
                    QuestUI.instance.AddCurrentStoneNumber();
                    QuestUI.instance.currentStoneNumber++;
                }

                if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "Wood")
                {
                    QuestUI.instance.currentWoodNumber++;
                }

                Destroy(hitInfo.transform.gameObject); //넣어준후 필드에있는 아이템은 삭제

                //얻은 아이템이 각각의 장비아이템인경우 무기체인지가 가능할수있게 해금.
                if (hitInfo.transform.name == "Axe_Item")
                {
                    theWeaponManager.IsChangeGetAxe();
                    if (!isFirstGetAxe && TutorialDialogue.instance == null)
                    {
                        isFirstGetAxe = true;
                        EventManager.instance.eventNumber = 3;
                        QuestUI.instance.AddCurrentAxeNumber(); //임시 퀘스트 하드코딩
                    }
                }

                if (hitInfo.transform.name == "Pickaxe_Item")
                {
                    Debug.Log(isFirstGetPickaxe);
                    theWeaponManager.IsChangeGetPickAxe();
                    if (!isFirstGetPickaxe)
                    {
                        Debug.Log("곡괭이이벤트");
                        isFirstGetPickaxe = true;
                        EventManager.instance.eventNumber = 5;
                        QuestUI.instance.AddCurrentPickAxeNumber(); //임시 퀘스트 하드코딩
                    }
                }
                if (hitInfo.transform.name == "SubMachineGun_Item")
                {
                    theWeaponManager.IsChangeGetSubMachineGun1();
                    if (!isFirstGetSubMachineGun1)
                    {
                        isFirstGetSubMachineGun1          = true;
                        EventManager.instance.eventNumber = 7;
                    }
                }


                InfoDisappear();
            }
        }
    }
示例#9
0
    private void CanPickUp()
    {
        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                if (hitInfo.transform.CompareTag("Book_EB")) //compare @
                {
                    // - 쪽지상태, 카운트 늘리기
                    pageNote_script.CheckAddcount(1);
                    // - 쪽지 매니저
                    notemager._popup = true;

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

                    // - 클릭버튼 비활성화
                    actionCaption.SetActive(false);

                    // - 책 팝업
                    endingBook_script.move_BookAni();

                    //카메라, 플레이어 이동 불가
                    fpCam_Script.enabled = false;
                    player_script.SetDeActiveAni();
                    player_script.enabled = false;

                    //책 팝업상태로 바꾸기
                    //eB_colider.enabled = false; //hitInfo.collider.enabled = false; -> RewardBook_Open으로 기능 옮김
                    isPopup = true;
                    InfoDisappear(); //info 삭제

                    //에임 없애기
                    Aim.SetActive(false);
                }

                if (isLastPage && !flipOver)
                {
                    if (hitInfo.transform.CompareTag("Key_EB")) //compare @
                    {
                        if (theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item))
                        {
                            //hitInfo.transform.GetComponent<PageNote>().CheckAddcount(1);

                            // - 아이템 습득
                            hitInfo.transform.gameObject.SetActive(false); //아이템 비활성화

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

                            // - 클릭버튼 비활성화
                            actionCaption.SetActive(false);

                            //
                            getKey = false;
                            InfoDisappear(); //info 삭제

                            // - 현관 라이트 켜기
                            //_lightOn_script.LightOnFront();

                            // - 엔딩 활성화
                            endingCtrller_script.enabled = true;
                        }
                    }
                }
            }
        }
    }
示例#10
0
    public void CanPickUp()
    {
        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "phone")
                {
                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    hitInfo.transform.gameObject.SetActive(false);
                    talkImg.SetActive(true);
                    talk_txt.text = "종이에 무늬와 문뒤의 무늬를 잘 매치해 보세요.";
                    Invoke("noShow", 3);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "woman_door")
                {
                    if (wodo)
                    {
                        wodo = false;
                        Woman_door.SetActive(false);
                        Woman_door_open.SetActive(true);
                    }
                    else
                    {
                        wodo = true;
                        Woman_door.SetActive(true);
                        Woman_door_open.SetActive(false);
                    }

                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "man_door")
                {
                    if (mando)
                    {
                        mando = false;
                        man_door.SetActive(false);
                        man_door_open.SetActive(true);
                    }
                    else
                    {
                        mando = true;
                        man_door.SetActive(true);
                        man_door_open.SetActive(false);
                    }
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "lock")
                {
                    if (lockbool)
                    {
                        lockbool = false;
                        lockUI.SetActive(true);
                        Cursor.lockState = CursorLockMode.None; // 게임 창 밖으로 마우스가 안나감
                        InfoDisappear();
                    }
                    else
                    {
                        lockbool = true;
                        lockUI.SetActive(false);
                        Cursor.lockState = CursorLockMode.Locked;
                        InfoDisappear();
                    }
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "hint")
                {
                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    hitInfo.transform.gameObject.SetActive(false);
                    InfoDisappear();
                }
            }
        }
    }
示例#11
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;
            }
        }
    }
示例#12
0
    public void CanPickUp()
    {
        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "handle")
                {
                    Debug.Log("테스투");
                    if (handlebool == 0)
                    {
                        talk_check = true;
                        talk.SetText();
                        InfoDisappear();
                        handlebool++;
                    }
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "bird")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "새 인형을 찾았다";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "dragon")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "용 인형을 찾았다";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "elephant")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "코끼리 인형을 찾았다";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "panda")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "판다 인형을 찾았다";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "rabit")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "토끼 인형을 찾았다";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "match")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "오 성냥이잖아! 불을 붙여 봐야겠다.";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "Rhinoceros")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = "귀여운 코뿔소 인형이네!";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "key")
                {
                    talkImg.SetActive(true);
                    talk_txt.text = " 열쇠다! 이걸로 나갈수 있을까?!";

                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "doorkey")
                {
                    theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item);
                    Destroy(hitInfo.transform.gameObject);
                    InfoDisappear();
                }
                Invoke("noShow", 3);
            }
        }
    }
    private void CanPickUp()
    {
        if (!outline_active) // 습득과 관련된 아이템은 외곽선과 상관 있다
        {
            return;
        }

        if (pickupActivated)
        {
            if (hitInfo.transform != null)
            {
                if (hitInfo.transform.CompareTag("Item"))
                {
                    if (theInventory.AcquireItem(hitInfo.transform.GetComponent <ItemPickUp>().item))
                    {
                        // 오류고치기
                        //// +
                        //DisplayLocation location_script = hitInfo2.transform.GetComponent<DisplayLocation>(); // @
                        //int display_index = location_script.location_Num;

                        //// +
                        //ItemPickUp pieceItem_script = hitInfo.transform.GetComponent<ItemPickUp>();
                        //pieceItem_script.get_layoutIndex();

                        //// +
                        ////if (!location_script.tryToPut_doll())
                        ////    return;
                        ////클릭한 장식장 위치와 아이템의 놓여진 위치가 동일하면


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

                        // - 아이템 습득
                        hitInfo.transform.gameObject.SetActive(false); //아이템 비활성화
                        //아이템에 달려있는 리지드 바디 비활성화
                        OutlineController.set_enabled(pre_ol_index, false);
                        OutlineController.set_check(false);
                        outline_active = false;

                        InfoDisappear();     //info 삭제

                        PickUp_state = true; // 습득한 상태로 변경 -> 이후 Check_use_Item에서 location_script의 상태 업데이트하기 위해서

                        // - 장식장 클릭 (인형이 놓여져있음)
                        if (hitInfo2.transform != null) //null @
                        {
                            if (hitInfo2.transform.CompareTag("Location"))
                            {
                                // - 습득당시, 장식장 위치를 정확하게 검사하기 위에서 조금 앞에 코드 놔둠
                                DisplayLocation location_script = hitInfo2.transform.GetComponent <DisplayLocation>(); // @
                                int             display_index   = location_script.location_Num;

                                // #
                                displayManager_script.reset_DisplayArry(display_index);
                            }
                        }
                    }
                    else if (hitInfo.transform.GetComponent <ItemPickUp>().item.itemName == "FlashlightItem")
                    {
                        //Destroy(hitInfo.transform.gameObject); //아이템 삭제, 나중엔 코루틴으로 #

                        // - 손전등(아이템) 비활성화
                        hitInfo.transform.gameObject.SetActive(false);
                        OutlineController.set_enabled(pre_ol_index, false);

                        // - 손전등 기능 on
                        FlashlightItem.SetActive(true);
                        flash_script.enabled = true;
                    }
                }
                else
                {
                }
            }
        }
    }