Example #1
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        textLimit           = 125;
        enterLimitCount     = 3;  //줄바꿈이 3번 일어나면 대화출력 종료 -> 대화창엔 3줄까지 출력될 것임
        tempLimitInOneLine  = 30; // 띄어쓰기 + 글자가 30자 이상일 경우, 강제로 줄바꿈
        isTextFull          = false;
        isSentenceDone      = false;
        atOnce              = false;
        isConversationing   = false;
        canSkipConversation = false;
        playerWantToSkip    = false;
        isFading            = false;
        isTypingText        = false;
        index                = 0;
        setOfDesc_Index      = 0;
        numNpcNameLists      = 0;
        curNumOfNpcNameLists = 0;
        sentences            = new string[] { "" };
        ispaused             = false;

        dataList         = GameObject.Find("DataManager").GetComponent <CSVParser>().GetEndingDataList();
        interactionLists = GameObject.Find("DataManager").GetComponent <CSVParser>().GetEndingInteractionLists();
        startObjectLists = GameObject.Find("DataManager").GetComponent <CSVParser>().GetEndingStartObjectLists();

        imagePathLists     = new List <string>(); //캐릭터 이미지 추가되면 적용(테스트) 해야함
        tempNpcNameLists   = new List <string>();
        sentenceLists      = new List <string>();
        setActiveTrueLists = new List <int>();

        npcParser = new NpcParser();

        SetAlphaToZero_ConversationUI();    //대화창 UI 투명화

        isFirstConversation = false;

        FadeInOutPanel.SetActive(false);
        FadeInOutPanelForClue.SetActive(false);

        /*혹시 몰라서 설정 한번 더 (다이얼로그 속도) 적용...*/
        SettingManager.instance.SetCurSetting();

        // (추후 이렇게 진행할 예정)
        // GameManager 에서 선택된 용의자를 용의자 변수에 저장하고, 해당 용의자에 따라서 endingState를 변경한다.
        // endingState 값에 따라서 엔딩을 시작한다.
        // EndingStart 함수를  호출한다.
        EndingStart(); // endingState 값에 따른 엔딩 시작
    }
Example #2
0
    public bool skipText;   // 대화 출력을 스킵할 때 사용


    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        /* for the character code test */
        er         = "1000";
        garbageBag = "1001";
        npcParser  = new NpcParser();

        //ClueList = new List<Clue>();
        ClueLists = new List <Clue> [5];  //Act5까지의 단서들 리스트

        playerClueLists = new List <ClueStructure>();
        playerClueLists_In_Certain_Timeslot = new List <ClueStructure>();

        //ClueLists 초기화
        for (int i = 0; i < ClueLists.Length; i++)
        {
            ClueLists[i] = new List <Clue>();
        }

        //NumOfAct = "54";   //사건4 시작
        //TimeSlot = "75";   //첫날 시작

        checkNumOfAct = NumOfAct;
        checkTimeSlot = TimeSlot;

        //currentPosition = "Downtown_Street1";
        currentPosition = "Chapter_Merte_Office"; // 메르테 위치 : 11419, 5169
        //currentPosition = "Chapter_Zaral_Office";
        //currentPosition = "Slum_Information_agency"; // -3212 -224

        isInPortalZone = false;

        playedEventList = new List <string>();
        eventVariable   = GameManager.instance.GetEventVariable();

        // 추후에, 상호작용 될 수 있는 오브젝트의 근처에 있을 때만 상호작용 되도록 할 것(1월 27일 메모)
        SetIsNearObject(true);

        skipText = false;
    }
Example #3
0
    // 획득 경로 2 파싱 (오브젝트 or 캐릭터명)
    public string ParsingObtainPos2(string posCode)
    {
        string obtainPos2 = "";

        try
        {
            npcParser = new NpcParser();

            // , 가 있다면 여러개 존재.
            if (posCode.Contains(","))
            {
                string[] nameArr = posCode.Split(',');
                for (int i = 0; i < nameArr.Length; i++)
                {
                    obtainPos2 += npcParser.GetNpcNameFromCode(nameArr[i]);

                    if (i != nameArr.Length - 1)
                    {
                        obtainPos2 += "&";
                    }
                }
            }
            else
            {
                // 스토리상 획득 위치 2가 없을 때
                if (posCode.Equals(""))
                {
                    return("");
                }

                // , 가 없으면 1개
                obtainPos2 += npcParser.GetNpcNameFromCode(posCode);
            }

            return(obtainPos2);
        }
        catch
        {
            return(obtainPos2);
        }
    }
Example #4
0
    /* 단서 정리 (해당 시간대에 얻은 단서들을 양피지에 띄우기위한 함수) 0115 추가 */
    public void MakeClueSlotInParchment()
    {
        // 플레이어가 현재 시간대에 얻은 단서들의 리스트를 가져온다.
        List <ClueStructure> certainClueLists = PlayerManager.instance.playerClueLists_In_Certain_Timeslot;
        int num_Clue = certainClueLists.Count;

        //Debug.Log(PlayerManager.instance.playerClueLists.Count);

        if (num_Clue == 0)
        {
            Debug.Log("현 시간대에 얻은 단서가 없음");
            // 양피지 위치 갱신
            ParchmentControll.instance.UpdateParchmentPosition(num_Clue);
            return;
        }

        GameObject addedSlot = slot_In_Parchment;   // 단서정리에 필요한 슬롯의 프리팹 정보를 담을 변수
        GameObject tempSlot;
        string     tempClueName;

        // 리스트에 있는 단서들의 수만큼 for문으로 slot을 만들어 넣는다.
        for (int i = 0; i < num_Clue; i++)
        {
            // 안드렌이 건네준 단서는 단서정리할때 양피지에 나타나지 않도록 한다.
            if (!CheckAndrenClue(certainClueLists, i))
            {
                ParchmentControll.instance.UpdateAdditionalCluePosition(i + 1);
                tempSlot = Instantiate(addedSlot, clueList_Panel_In_Parchment.transform);
                tempSlot.GetComponent <RectTransform>().localPosition = new Vector3(tempSlot.GetComponent <RectTransform>().localPosition.x, ParchmentControll.instance.additional_Clue_Pos_y, tempSlot.GetComponent <RectTransform>().localPosition.z);
                slotList_In_Parchment.Add(tempSlot);
                tempClueName = certainClueLists[i].GetClueName();
                //tempSlot.transform.GetChild(0).Find("CluePortrait").GetComponent<Image>().sprite = Resources.Load<Sprite>("Image/AboutClue/ClueImage/" + tempClueName);

                NpcParser npcParser         = new NpcParser();
                string    tempObtainPosCode = certainClueLists[i].GetObtainPos2Code();
                int       tempCode          = 0;

                if (tempObtainPosCode.Equals("1"))
                {
                    tempCode = 1;
                }
                else if (tempObtainPosCode.Length == 4)
                {
                    tempCode = int.Parse(tempObtainPosCode);
                }

                if (tempCode == 1)
                {
                    tempSlot.transform.GetChild(0).Find("CluePortrait").GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/AboutClue/SlotImage/Document_Sketch");
                }
                else if (tempCode >= 9000)
                {
                    tempSlot.transform.GetChild(0).Find("CluePortrait").GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/AboutClue/SlotImage/Object_Sketch");
                }
                else
                {
                    tempSlot.transform.GetChild(0).Find("CluePortrait").GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/AboutClue/SlotImage/Human_Sketch");
                }

                tempSlot.transform.GetChild(0).Find("ClueName").GetComponent <Text>().text = "" + tempClueName;
            }
        }

        // 양피지 위치 갱신
        ParchmentControll.instance.UpdateParchmentPosition(num_Clue);

        //// 현재 시간대에 가지고 있는 단서 리스트 초기화
        //PlayerManager.instance.ResetClueList_In_Certain_Timeslot();
    }