private void CheckJoystickControl() { if (m_Joystack == null) { return; } float dir = m_Joystack.GetJoystackDir(); if (m_Joystack.IsDrag()) { m_MovementStateInfo.IsMoving = true; m_MovementStateInfo.SetMoveDir(dir); m_MovementStateInfo.TargetPosition = Vector3.zero; } else { m_MovementStateInfo.IsMoving = false; m_MovementStateInfo.SetMoveDir(dir); m_MovementStateInfo.TargetPosition = Vector3.zero; } }
public static void AiPursue(EntityInfo npc, ScriptRuntime.Vector3 target) { MovementStateInfo msi = npc.GetMovementStateInfo(); msi.IsMoving = true; msi.TargetPosition = target; float dir = Geometry.GetYRadian(msi.GetPosition3D(), target); msi.SetFaceDir(dir); msi.SetMoveDir(dir); Msg_RC_NpcMove npcMoveBuilder = DataSyncUtility.BuildNpcMoveMessage(npc); if (null != npcMoveBuilder) { Scene scene = npc.SceneContext.CustomData as Scene; if (null != scene) { scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcMove, npcMoveBuilder); } } }