internal void OnGesture(GestureArgs e) { if (null != e) { m_LastTouchPos = m_CurTouchPos; m_CurTouchPos = new Vector3(e.positionX, e.positionY, 0); m_TouchRayPoint = new Vector3(e.gamePosX, e.gamePosY, e.gamePosZ); } Fire((int)TouchEvent.Cesture, e); /// string ename = e.name; if (GestureEvent.OnFingerDown.ToString() == ename) { if (null != OnFingerDown) { OnFingerDown(e); } } else if (GestureEvent.OnFingerUp.ToString() == ename) { if (null != OnFingerUp) { OnFingerUp(e); } } }
private void Fire(int c, GestureArgs e) { MyAction <int, GestureArgs> handler; if (null != m_LogicInvoker && m_TouchHandlers.TryGetValue(c, out handler)) { QueueLogicActionWithDelegation(handler, c, e); } }
/// Joystick internal void SetJoystickInfoImpl(GestureArgs e) { if (null != e) { m_CurJoyDir = e.towards; m_CurJoyTargetPos.x = e.airWelGamePosX; m_CurJoyTargetPos.y = e.airWelGamePosY; m_CurJoyTargetPos.z = e.airWelGamePosZ; } }
private void TouchHandle(int what, GestureArgs e) { try { UserInfo playerself = WorldSystem.Instance.GetPlayerSelf(); if (null == playerself || null == e) { return; } CharacterView view = EntityManager.Instance.GetUserViewById(playerself.GetId()); if (null != playerself.SkillController && playerself.SkillController.GetSkillControlMode() != SkillControlMode.kTouch) { return; } if ((int)TouchEvent.Cesture == what) { string ename = e.name; if (GestureEvent.OnSingleTap.ToString() == ename) { if (EnableMoveInput) { if (WorldSystem.Instance.IsPureClientScene() || WorldSystem.Instance.IsPveScene()) { if (e.selectedObjID < 0) { playerself.SkillController.AddBreakSkillTask(); if (InputType.Touch == e.inputType) { FindPath(new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ)); } else if (InputType.Joystick == e.inputType) { UpdateMoveState(playerself, new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ), e.towards); } UpdateTowards(playerself, e.towards); } else { Combat(playerself, e.selectedObjID, e.attackRange); } m_lastSelectObjId = e.selectedObjID; /// // GfxSystem.PublishGfxEvent("Op_InputEffect", "Input", GestureEvent.OnSingleTap, e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ, e.selectedObjID < 0 ? false : true, true); } else if (WorldSystem.Instance.IsPvpScene() || WorldSystem.Instance.IsMultiPveScene()) { if (e.selectedObjID < 0) { if (InputType.Touch == e.inputType) { NetworkSystem.Instance.SyncPlayerMoveToPos(new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ)); } else if (InputType.Joystick == e.inputType) { UpdateMoveState(playerself, new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ), e.towards); playerself.SkillController.AddBreakSkillTask(); } } else { NetworkSystem.Instance.SyncPlayerMoveToAttack(e.selectedObjID, e.attackRange); } } } } else if (GestureEvent.OnFingerMove.ToString() == ename) { if (EnableMoveInput) { if (view.ObjectInfo.IsGfxMoveControl && !view.ObjectInfo.IsGfxRotateControl) { UpdateTowards(playerself, e.towards); } } } else if (GestureEvent.OnSkillStart.ToString() == ename) { if (null != playerself) { UserAiStateInfo info = playerself.GetAiStateInfo(); if ((int)AiStateId.Move == info.CurState) { StopFindPath(playerself, info); } } } else if (GestureEvent.OnEasyGesture.ToString() == ename) { Vector3 targetpos = new Vector3(e.startGamePosX, e.startGamePosY, e.startGamePosZ); if (Vector3.Zero != targetpos) { PushSkill(playerself, targetpos, e.attackRange); } } } } catch (Exception ex) { LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
public static void SetJoystickInfo(GestureArgs args) { GfxSystem.Instance.SetJoystickInfoImpl(args); }
public static void FireGestureEvent(GestureArgs args) { GfxSystem.Instance.OnGesture(args); }