| | |
| | | monsterList[i].npcID = (uint)EditorGUILayout.IntField((int)monsterList[i].npcID, guiSkin.textField, GUILayout.Height(20), GUILayout.Width(70)); |
| | | EditorGUILayout.LabelField("模型名", guiSkin.customStyles[0], GUILayout.Height(20), GUILayout.Width(50)); |
| | | monsterList[i].resName = EditorGUILayout.TextField(monsterList[i].resName, guiSkin.textField, GUILayout.Height(20), GUILayout.Width(70)); |
| | | EditorGUILayout.LabelField("朝向", guiSkin.customStyles[0], GUILayout.Height(22), GUILayout.Width(50)); |
| | | EditorGUILayout.LabelField("朝向", guiSkin.customStyles[0], GUILayout.Height(22), GUILayout.Width(30)); |
| | | monsterList[i].faceDir = EditorGUILayout.IntField(monsterList[i].faceDir, guiSkin.textField, GUILayout.Height(22), GUILayout.Width(70)); |
| | | if (GUILayout.Button("定高", guiSkin.button, GUILayout.Width(60), GUILayout.Height(20))) |
| | | { |
| | |
| | | public uint npcID; |
| | | public Vector3 position; |
| | | public int ai; |
| | | public int faceDir; |
| | | |
| | | public void Load(BinaryReader br) |
| | | { |
| | | npcID = br.ReadUInt32(); |
| | | ai = br.ReadByte(); |
| | | faceDir = br.ReadInt32(); |
| | | float _x = br.ReadSingle(); |
| | | float _y = br.ReadSingle(); |
| | | float _z = br.ReadSingle(); |
| | |
| | | int _configID = _dataMapID * 10 + _dgModel.mission.lineID;
|
| | | DungeonConfig _dgConfig = DungeonConfig.Get(_configID);
|
| | |
|
| | | if (_dgConfig.AutomaticATK > 1)
|
| | | if (_dgConfig != null && _dgConfig.AutomaticATK > 1)
|
| | | {
|
| | | m_Hero.aiHandler.currentType = (E_HeroAIType)_dgConfig.AutomaticATK;
|
| | | }
|
| | |
| | | // 这里判断是否要走向此对象 |
| | | if (_chkDistSqrt > 4) |
| | | { |
| | | _hero.MoveToPosition(Pos, 1.5f); |
| | | _hero.MoveToPosition(Pos, 2f); |
| | | } |
| | | } |
| | | |
| | |
| | | Vector3 _forward = MathUtility.ForwardXZ(Pos, _hero.Pos);
|
| | | _hero.Forward = _forward;
|
| | |
|
| | | _forward = MathUtility.ForwardXZ(_hero.Pos, Pos);
|
| | | Forward = _forward;
|
| | | if (NpcConfig.AutomaticFace == 1)
|
| | | {
|
| | | _forward = MathUtility.ForwardXZ(_hero.Pos, Pos);
|
| | | Forward = _forward;
|
| | | }
|
| | | }
|
| | |
|
| | | public override void OnUnSelect()
|
| | |
| | |
|
| | | private void CheckCanCollect()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31230)
|
| | | if (PlayerDatas.Instance.baseData.MapID == 31230)// 仙盟宴会
|
| | | {
|
| | | FuncConfigConfig _funcConfig = FuncConfigConfig.Get("FamilyPartyDeskNpcID");
|
| | | m_CanCollect = int.Parse(_funcConfig.Numerical1) == NpcConfig.NPCID && !xmlsCollectFinished;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (NpcConfig.NPCID == GeneralDefine.GatherSoulDZ)
|
| | | if (NpcConfig.NPCID == GeneralDefine.GatherSoulDZ)// 聚魂副本
|
| | | {
|
| | | m_CanCollect = true;
|
| | | }
|
| | | else if (ModelCenter.Instance.GetModel<HazyGrassModel>().IsInDungeon)
|
| | | {
|
| | | m_CanCollect = true;
|
| | | }
|
| | |
| | | m_CanCollect = _model.IsGather(NpcConfig.NPCID);
|
| | | }
|
| | | }
|
| | |
|
| | | if (!m_CanCollect)
|
| | | {
|
| | | if (m_ArrivedList.Contains(ServerInstID))
|
| | |
| | | if (CanBeSelected())
|
| | | {
|
| | | m_NPCInteractProcessor = Root.AddMissingComponent<NPCInteractProcessor>();
|
| | | m_NPCInteractProcessor.npcIntergactEvent -= OnClick;
|
| | | m_NPCInteractProcessor.npcIntergactEvent += OnClick;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private float m_EulerAngles;
|
| | | public float EulerAngles
|
| | | {
|
| | | get { return m_EulerAngles; }
|
| | | set
|
| | | {
|
| | | m_EulerAngles = value;
|
| | | if (m_Root)
|
| | | {
|
| | | m_Root.eulerAngles = new Vector3(0, m_EulerAngles, 0);
|
| | | m_Forward = m_Root.forward;
|
| | | m_Rotation = Quaternion.LookRotation(m_Forward, Vector3.up);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private Vector3 m_Forward;
|
| | | public Vector3 Forward
|
| | | {
|
| | |
| | |
|
| | | if (NavMesh.CalculatePath(_curPos, position, NavMesh.AllAreas, m_Path))
|
| | | {
|
| | | // if (this is GA_Hero)
|
| | | // {
|
| | | // Debug.LogFormat("调用了 {0} 的寻路, 目标点: {1}", ServerInstID, position);
|
| | | // }
|
| | | if (this is GA_Hero)
|
| | | {
|
| | | Debug.LogFormat("调用了 {0} 的寻路, 目标点: {1}", ServerInstID, position);
|
| | | }
|
| | | m_CornerIndex = 0;
|
| | | m_KeepDist = keepDist;
|
| | | PathFindStatus = E_PathFindStatus.Moving;
|
| | |
| | | } |
| | | _npc.BornPos = _npc.Pos = _data.position; |
| | | _npc.belongEventID = m_Evt.id; |
| | | if (_data.faceDir != 0) |
| | | { |
| | | _npc.EulerAngles = _data.faceDir; |
| | | } |
| | | ClientSceneManager.Instance.NpcBorn(m_Evt.id, _npc); |
| | | } |
| | | } |