예제 #1
0
 private void Fire(int c, GestureArgs e)
 {
     if (null != m_LogicInvoker && m_TouchHandlers.ContainsKey(c))
     {
         MyAction <int, GestureArgs> handler = m_TouchHandlers[c];
         m_LogicInvoker.QueueAction(() => { handler(c, e); });
     }
 }
예제 #2
0
 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);
 }
예제 #3
0
        private void TouchHandle(int what, GestureArgs e)
        {
            UserInfo playerself = WorldSystem.Instance.GetPlayerSelf();

            if (null == playerself || null == e)
            {
                return;
            }
            if ((int)TouchEvent.Cesture == what)
            {
                string ename = e.name;
                if (GestureEvent.OnSingleTap.ToString() == ename)
                {
                    if (EnableMoveInput)
                    {
                        if (WorldSystem.Instance.IsPveScene())
                        {
                            if (e.selectedObjID < 0)
                            {
                                FindPath(playerself, new Vector3(e.airWelGamePosX, e.airWelGamePosY, e.airWelGamePosZ), 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
                        {
                            Vector3 world_pos = new Vector3(GfxSystem.GetTouchRayPointX(), GfxSystem.GetTouchRayPointY(), GfxSystem.GetTouchRayPointZ());
                            NetworkSystem.Instance.SyncPlayerFindPath(world_pos);
                        }
                    }
                }
                else if (GestureEvent.OnFingerMove.ToString() == ename)
                {
                    if (EnableMoveInput)
                    {
                        if (TouchType.Attack == e.moveType)
                        {
                            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);
                    }
                }

                //LogSystem.Debug("userid:{0}, input event:{1}", playerself.GetId(), e.name);
            }
        }
예제 #4
0
 public static void FireGestureEvent(GestureArgs args)
 {
     GfxSystem.Instance.OnGesture(args);
 }