Esempio n. 1
0
    public override void AfterAutoPath()
    {
        if (NrTSingleton <FormsManager> .Instance.IsShow(G_ID.NPCTALK_DLG))
        {
            return;
        }
        QuestAutoPathInfo autoPathInfo = NrTSingleton <NkQuestManager> .Instance.GetAutoPathInfo();

        if (autoPathInfo != null)
        {
            NrCharNPC nrCharNPC = (NrCharNPC)NrTSingleton <NkCharManager> .Instance.GetCharByCharKind(autoPathInfo.m_nCharKind);

            if (nrCharNPC != null && autoPathInfo.m_nCharKind > 0 && nrCharNPC != null)
            {
                NrCharKindInfo charKindInfo = nrCharNPC.GetCharKindInfo();
                if (charKindInfo != null)
                {
                    NpcTalkUI_DLG npcTalkUI_DLG = (NpcTalkUI_DLG)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NPCTALK_DLG);

                    npcTalkUI_DLG.SetNpcID(charKindInfo.GetCharKind(), nrCharNPC.GetCharUnique());
                    npcTalkUI_DLG.Show();
                }
            }
        }
    }
Esempio n. 2
0
    public override void AfterAutoPath()
    {
        QuestAutoPathInfo autoPathInfo = NrTSingleton <NkQuestManager> .Instance.GetAutoPathInfo();

        if (autoPathInfo != null)
        {
            NrCharNPC nrCharNPC = (NrCharNPC)NrTSingleton <NkCharManager> .Instance.GetCharByCharKind(autoPathInfo.m_nCharKind);

            if (nrCharNPC != null && autoPathInfo.m_nCharKind > 0 && nrCharNPC != null)
            {
                NrCharKindInfo charKindInfo = nrCharNPC.GetCharKindInfo();
                if (charKindInfo != null)
                {
                    NpcTalkUI_DLG npcTalkUI_DLG = (NpcTalkUI_DLG)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NPCTALK_DLG);

                    npcTalkUI_DLG.SetNpcID(charKindInfo.GetCharKind(), nrCharNPC.GetCharUnique());
                    npcTalkUI_DLG.Show();
                    CHARKIND_NPCINFO cHARKIND_NPCINFO = charKindInfo.GetCHARKIND_NPCINFO();
                    if (cHARKIND_NPCINFO != null && !string.IsNullOrEmpty(cHARKIND_NPCINFO.SOUND_GREETING))
                    {
                        TsAudioManager.Instance.AudioContainer.RequestAudioClip("NPC", cHARKIND_NPCINFO.SOUND_GREETING, "GREETING", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
                    }
                }
            }
        }
    }
Esempio n. 3
0
    public bool CheckAutoMoveKind()
    {
        QuestAutoPathInfo autoPathInfo = NrTSingleton <NkQuestManager> .Instance.GetAutoPathInfo();

        if (autoPathInfo != null)
        {
            if (!autoPathInfo.m_bComplete)
            {
                autoPathInfo.m_kQuest.AfterAutoPath();
            }
            else if (autoPathInfo.m_nCharKind > 0)
            {
                NrCharBase charByCharKind = NrTSingleton <NkCharManager> .Instance.GetCharByCharKind(autoPathInfo.m_nCharKind);

                if (charByCharKind != null)
                {
                    if (!this.m_pkChar.IsCloseToTalkNPC(ref charByCharKind, 2f))
                    {
                        return(false);
                    }
                    NrCharKindInfo charKindInfo = charByCharKind.GetCharKindInfo();
                    if (charKindInfo != null)
                    {
                        NpcTalkUI_DLG npcTalkUI_DLG = (NpcTalkUI_DLG)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.NPCTALK_DLG);

                        if (npcTalkUI_DLG != null)
                        {
                            npcTalkUI_DLG.SetNpcID(charKindInfo.GetCharKind(), charByCharKind.GetCharUnique());
                            npcTalkUI_DLG.Show();
                        }
                        CHARKIND_NPCINFO cHARKIND_NPCINFO = charKindInfo.GetCHARKIND_NPCINFO();
                        if (cHARKIND_NPCINFO != null && !string.IsNullOrEmpty(cHARKIND_NPCINFO.SOUND_GREETING))
                        {
                            TsAudioManager.Instance.AudioContainer.RequestAudioClip("NPC", cHARKIND_NPCINFO.SOUND_GREETING, "GREETING", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
                        }
                    }
                    if (charByCharKind.GetCharObject() != null)
                    {
                        Vector3 position = charByCharKind.GetCharObject().transform.position;
                        this.m_pkChar.m_k3DChar.RequestLookAt(position.x, position.z);
                    }
                    return(true);
                }
                else
                {
                    Debug.Log("null == npc");
                }
            }
            NrTSingleton <NkQuestManager> .Instance.SetAutoPathInfo(null);
        }
        return(false);
    }