public void SetFocus(bool focus) { if (focus) { MsgInteractiveInfo msg = MessageSingleton.Get <MsgInteractiveInfo>(); msg.Describe = null; MissionProxy missionProxy = GameFacade.Instance.RetrieveProxy(ProxyName.MissionProxy) as MissionProxy; if (missionProxy.GetCanSubmitMissionBy(GetTemplateID()) == null) { string fKeyText = missionProxy.GetTalkMissionFKeyText(GetTemplateID()); if (!string.IsNullOrEmpty(fKeyText)) { msg.Describe = fKeyText; } } msg.Tid = GetTemplateID(); msg.MustUseHumanFBox = false; GameFacade.Instance.SendNotification(NotificationName.MSG_INTERACTIVE_SHOWFLAG, msg); } else { GameFacade.Instance.SendNotification(NotificationName.MSG_INTERACTIVE_HIDEFLAG); if (m_NpcTmpVO.DialogueTurn == 1) { GetSkinTransform().DORotateQuaternion(m_BornServerRotation, 0.5f); } } }
/// <summary> /// NPC选中时 /// </summary> /// <param name="npcID">交互信息</param> private void OnNpcSelect(MsgInteractiveInfo msg) { int npcID = (int)msg.Tid; string describe = msg.Describe; m_MustUseHumanFBox = msg.MustUseHumanFBox; if (m_FocusNpcTid != npcID) { m_FocusNpcTid = npcID; m_FocusNpcOffset = Vector3.zero; CfgEternityProxy eternity = Facade.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy; m_FocusNpcVO = eternity.GetNpcByKey((uint)m_FocusNpcTid); if (m_FocusNpcVO.FPosOffestLength >= 3) { m_FocusNpcOffset = new Vector3(m_FocusNpcVO.FPosOffest(0), m_FocusNpcVO.FPosOffest(1), m_FocusNpcVO.FPosOffest(2)); } } RebuildView(describe); }