Esempio n. 1
0
    public NPCData GetNPCDataRandom(NPC_TYPE npc_type, List <int> exclusion_ids = null)
    {
        List <int> range = npcTypeOnNpcIdList[(int)npc_type].GetRange(0, npcTypeOnNpcIdList[(int)npc_type].Count);

        if (exclusion_ids != null)
        {
            int i = 0;
            for (int count = exclusion_ids.Count; i < count; i++)
            {
                int num = range.IndexOf(exclusion_ids[i]);
                if (num >= 0)
                {
                    range.RemoveAt(num);
                }
            }
        }
        if (range.Count <= 0)
        {
            range = npcTypeOnNpcIdList[(int)npc_type].GetRange(0, npcTypeOnNpcIdList[(int)npc_type].Count);
        }
        int index = (int)(Random.get_value() * (float)range.Count);
        int key   = range[index];

        return(npcDataTable.Get((uint)key));
    }
Esempio n. 2
0
 public string GetTalk(NPC_TYPE id, int talkindex)
 {
     if (talkindex == m_talkData[id].Length)
     {
         return(null);
     }
     else
     {
         return(m_talkData[id][talkindex]);
     }
 }
Esempio n. 3
0
    public string CheckQuest(NPC_TYPE _id)
    {
        if (_id == questDic[questId].npcId[questActionIndex])
        {
            questActionIndex++;
        }

        if (questActionIndex == questDic[questId].npcId.Length)
        {
            NextQuest();
        }

        return(questDic[questId].questName);
    }
Esempio n. 4
0
    void Talk(NPC_TYPE _npcId)
    {
        int    questTalkIndex = quest.GetQuestTalkIndex(_npcId);
        string talkData       = talkManager.GetTalk(_npcId + questTalkIndex, talkIndex);

        //대화 끝날 때
        if (talkData == null)
        {
            isClick   = false;
            talkIndex = 0;
            return;
        }

        talkText.text = talkData;

        isClick = true;
        talkIndex++;
    }
Esempio n. 5
0
 public int GetQuestTalkIndex(NPC_TYPE _id)
 {
     return(questId + questActionIndex);
 }
Esempio n. 6
0
 public GameObject GetPortrait(NPC_TYPE id)
 {
     return(m_portraitData[id]);
 }