コード例 #1
0
    public void OnTouchDown(INotifyArgs e)
    {
        TouchInvoke touchInvoke = (TouchInvoke)e;

        if (touchInvoke.TouchGO == gameObject && m_roleState == RoleState.Init && !m_lockRole)  //只有角色处理Init状态才响应点击选择
        {
            UIEventManager.Instance.TriggerUIEvent(UIEventType.SelectRole, m_curRoleData._VocationID);
        }
    }
コード例 #2
0
    private void OnTouchDown(INotifyArgs e)
    {
        TouchInvoke touchInvoke = (TouchInvoke)e;

        if (touchInvoke.TouchGO == gameObject)
        {
            if (ShowTaskNpcPanel != null && !TaskModel.Instance.isNpcTalking)
            {
                SoundManager.Instance.PlaySoundEffect("Sound_Button_Task_QuickGuide ");
                ShowTaskNpcPanel(m_storyPersonInfo);
            }
        }
    }
コード例 #3
0
    public void OnTouchDown(INotifyArgs e)
    {
        TouchInvoke touchInvoke = (TouchInvoke)e;

        if (touchInvoke.TouchGO == gameObject)
        {
            RaiseEvent(EventTypeEnum.TargetSelected.ToString(), new TargetSelected()
            {
                Target = transform, Type = ResourceType.Portal
            });
            m_preTrans = transform;
        }
    }
コード例 #4
0
    public void OnTouchDown(INotifyArgs e)
    {
        TouchInvoke touchInvoke = (TouchInvoke)e;

        if (touchInvoke.TouchGO == gameObject)
        {
            RaiseEvent(EventTypeEnum.TargetSelected.ToString(), new TargetSelected()
            {
                Target = transform, Type = ResourceType.NPC
            });
            var playerBehaviour = (PlayerBehaviour)PlayerManager.Instance.FindHeroEntityModel().Behaviour;
            if (playerBehaviour.FSMSystem.CurrentStateID == StateID.PlayerFindPathing)
            {
                PlayerManager.Instance.HeroAgent.enabled = false;
                //playerBehaviour.FSMSystem.PerformTransition(Transition.PlayerToIdle);
            }

            m_preTrans = transform;
        }
    }
コード例 #5
0
    /*void TestFun()
     * {
     *      if (npcTest == null) {
     *              npcTest = GameObject.Find("JH_Mod_NPC104(Clone)").transform;
     *      }
     *      Vector3 pos1 = new Vector3 (3,0,0);
     *      Vector3 pos2 = new Vector3 (0,4,0);
     *      pos1 = pos1 - Vector3.Project (pos1,Vector3.up);
     *      pos2 = pos2 - Vector3.Project (pos2,Vector3.up);
     *      float angle1 = Vector3.Angle (pos1,pos2);
     *      float angle2 = Vector3.Angle (pos2,pos1);
     *
     *      Vector3 pp1 = npcTest.position - Vector3.Project (npcTest.position,Vector3.up);
     *      Vector3 pp2 = transform.position - Vector3.Project (transform.position,Vector3.up);
     *
     *
     *      Debug.Log ("angle1="+angle1+"angle2="+angle2+"----------"+Vector3.Angle(pp1,pp2)+"--=="+(Vector3.Angle(transform.forward,(npcTest.position-transform.position))));
     *
     *
     *
     *      Vector3 selfPos = npcTest.position;
     *      Vector3 poss = transform.InverseTransformPoint(selfPos);
     *      bool inAngle = false;
     *      float newAng = Vector3.Angle (Vector3.forward, poss);
     *      Debug.Log ("newAng="+newAng);
     * }*/
    /// <summary>
    /// ÊÕµœµã»÷ÖžÁ»ò·ÅŒŒÄÜ£¬»òÐÐ×ß
    /// </summary>
    /// <param name="touchInvoke"></param>
    //private Transform npcTest ;
    public void GetTouchDown(TouchInvoke touchInvoke)
    {
        if (this.IsDie || BattleManager.Instance.BlockPlayerToIdle)
        {
            return;
        }

        /*if (IsInvoking ("TestFun"))
         *      CancelInvoke ("TestFun");
         * InvokeRepeating ("TestFun",2,2);*/
        if (GameManager.Instance.CurrentState == GameManager.GameState.GAME_STATE_PLAYERROOM)
        {
            return;
        }
        if (touchInvoke.TouchGO.tag.ToLower() == "terrain")
        {
            if (GameManager.Instance.CurrentState == GameManager.GameState.GAME_STATE_TOWN)
            {
                if (TaskModel.Instance.isNpcTalking)
                {
                    return;
                }
            }
            this.m_LastWalkToPosition = touchInvoke.TouchPoint; //°Ñ×îºóÒ»žöµã»÷µãŒÇÂŒÏÂÀŽ
            UIEventManager.Instance.TriggerUIEvent(UIEventType.AddAPMNumber, null);
            StateID sId = m_FSMSystem.CurrentState.StateID;
            if (sId == StateID.PlayerInitialtiveSkillSelect ||
                sId == StateID.PlayerInitiativeSkill)
            {
                if (sId == StateID.PlayerInitialtiveSkillSelect)
                {
                    InitiativeSkillSelectedState state = (InitiativeSkillSelectedState)(m_FSMSystem.CurrentState);
                    state.OnTouch(touchInvoke.TouchPoint);
                }
                else
                {
                    PlayerInitiativeSkillFireState state = (PlayerInitiativeSkillFireState)(m_FSMSystem.CurrentState);
                    state.OnTouch(touchInvoke.TouchPoint);
                }
            }
            else if (touchInvoke.TouchCount == 1)
            {
                WalkToPosition = touchInvoke.TouchPoint;
                TargetType     = ResourceType.Terrain;
                if (GameManager.Instance.CurrentState == GameManager.GameState.GAME_STATE_BATTLE &&
                    m_FSMSystem.CurrentStateID == StateID.PlayerRun)
                {
                    m_LastWalkToPosition = null;
                    ((PlayerRunState)m_FSMSystem.CurrentState).StartToRun(2.0f, 2.0f);
                }

                if (m_FSMSystem.CurrentStateID == StateID.PlayerFindPathing)
                {
                    transform.GetComponent <NavMeshAgent>().enabled = false;
                    m_FSMSystem.PerformTransition(Transition.PlayerToIdle);
                }

                /*
                 * if (GameManager.Instance.CurrentState == GameManager.GameState.GAME_STATE_BATTLE
                 * && m_FSMSystem.CurrentStateID == StateID.PlayerBeAdsorb)
                 * {
                 * ((PlayerBeAdsorbState)m_FSMSystem.CurrentState).Run(WalkToPosition.Value);
                 * }
                 */
            }
            else if (touchInvoke.TouchCount == 2 &&
                     GameManager.Instance.CurrentState == GameManager.GameState.GAME_STATE_BATTLE)
            {
                /*
                 * var skillId = PlayerDataManager.Instance.GetBattleItemData(this.PlayerKind).ScrollSkillID;
                 * var skillConfig = SkillDataManager.Instance.GetSkillConfigData(skillId);
                 * if (!BreakSkillCheck(skillConfig))
                 * {
                 * return;
                 * }
                 * //Add by limanru
                 * if (PlayerGasSlotManager.Instance.IsCanRoll())
                 * {
                 * PlayerGasSlotManager.Instance.ConsumeOneRollAirSlot(1);
                 * }
                 * else
                 * {
                 * return;
                 * }
                 * ChangeForward(touchInvoke.TouchPoint);
                 * m_FSMSystem.PerformTransition(Transition.PlayerFireScrollSkill);
                 */
            }
        }
    }