/// <summary> /// 人物的移动方向 /// </summary> /// <param name="d"></param> /// <returns></returns> public bool MoveTo(Point3D newLocation) { BaseMap tempMap = m_Map; // 副本防止多线程置空 if (m_Deleted == true || tempMap == null) { return(false); } MoveToEventArgs eventArgs = GlobalEvent.BaseCharacter.InvokeMoveTo(newLocation, this); if (eventArgs != null) { if (eventArgs.Blocked == true) { return(false); } } Point3D oldLocation = (Point3D)m_Location; if (m_GameEntityState != null) { if (m_GameEntityState.OnMovingTo(newLocation, this) == true) { return(false); } } this.Location = newLocation; // 间接设置 tempMap.OnMove(oldLocation, this); m_GameEntityState.IsMoveToCall = true; if (m_GameEntityState != null) { m_GameEntityState.OnMovedTo(oldLocation, this); } return(true); }