コード例 #1
0
 public AgentInfo(ENpcTalkType type, ENpcSpeakType spType, bool canLoop = false)
 {
     _type      = type;
     _spType    = spType;
     _startTime = Time.time;
     _canLoop   = canLoop;
     _loopTime  = NpcRandomTalkDb.Get(type)._interval;
 }
コード例 #2
0
        public void AddAgentInfo(ENpcTalkType type, ENpcSpeakType spType, bool canLoop = false)
        {
            if (_msgs == null)
            {
                _msgs = new AgentInfo[(int)ENpcTalkType.Max];
            }

            AddAgentInfo(new AgentInfo(type, spType, canLoop));
        }
コード例 #3
0
        public void NpcSayOneWord(int _contentId, float _interval, ENpcSpeakType _type)
        {
            Texture  tex      = faceTex;
            string   _content = "";
            string   _npcName = "";
            TalkData talkdata = TalkRespository.GetTalkData(_contentId);;

//            if (Entity.entityProto.proto == EEntityProto.RandomNpc)
//                _npcName = characterName.givenName + ":";
//            else if (Entity.entityProto.proto == EEntityProto.Npc)
//                _npcName = characterName.familyName + ":";
            _npcName = characterName.fullName + ":";

            if (talkdata != null)
            {
                _content = talkdata.m_Content;
                //lz-2016.11.04 替换npc说话内容中的玩家名字
                _content = _content.Replace("\"name%\"", Pathea.PeCreature.Instance.mainPlayer.ToString());
            }

            if (_type == ENpcSpeakType.Topleft)
            {
                new PeTipMsg(_npcName + _content, tex, PeTipMsg.EMsgLevel.Norm);
            }
            else if (_type == ENpcSpeakType.TopHead)
            {
                //Log:lz-2016.04.29:唐小力 错误 #1851仆从头上的提示信息取消名字开头
                if (mHeadInfo != null)
                {
                    mHeadInfo.SayOneWord(_content, _interval);
                }
            }
            else if (_type == ENpcSpeakType.Both)
            {
                new PeTipMsg(_npcName + _content, tex, PeTipMsg.EMsgLevel.Norm);
                //Log:lz-2016.04.29:唐小力 错误 #1851仆从头上的提示信息取消名字开头
                if (mHeadInfo != null)
                {
                    mHeadInfo.SayOneWord(_content, _interval);
                }
            }
        }