Beispiel #1
0
    private void SkillStartHandler()
    {
        GestureArgs e = new GestureArgs();

        e.name = GestureEvent.OnSkillStart.ToString();
        LogicSystem.FireGestureEvent(e);
    }
Beispiel #2
0
    void OnTriggerEnter(Collider other)
    {
        //玩家进入该区域触发
        if (other.tag != "Player")
        {
            return;
        }
        if (NextSceneId <= 0)
        {
            return;
        }
        GameObject uiRoot = GameObject.FindGameObjectWithTag("UI");

        if (uiRoot != null)
        {
            uiRoot.BroadcastMessage("OnStopBtnClicked");
        }
        ///
        JoyStickInputProvider.JoyStickEnable = false;
        GestureArgs e = new GestureArgs();

        e.name           = "OnSingleTap";
        e.airWelGamePosX = 0f;
        e.airWelGamePosY = 0f;
        e.airWelGamePosZ = 0f;
        e.selectedObjID  = -1;
        LogicSystem.FireGestureEvent(e);

        //通知逻辑层切换场景
        Debug.LogError("Change to Scene : " + NextSceneId);
        LogicSystem.PublishLogicEvent("ge_change_scene", "game", NextSceneId);
    }
Beispiel #3
0
    public static void FireEvent(Gesture gesture)
    {
        if (!TouchEnable)
        {
            return;
        }
        if (!GestureEnable)
        {
            return;
        }

        if (null != gesture.Recognizer && "OnEasyGesture" != gesture.Recognizer.EventMessageName)
        {
            GestureArgs e = ToGestureArgs(gesture);
            LogicSystem.FireGestureEvent(e);
        }

        if (ArkCrossEngine.PlayerControl.Instance.EnableSkillInput)
        {
            if (OnGestureEvent != null)
            {
                OnGestureEvent(gesture);
            }
        }

        //Debug.Log("...input SkillTags : " + gesture.SkillTags + ", event : " + gesture.Recognizer.EventMessageName + ", state : " + curTouchState.ToString());
    }
Beispiel #4
0
 private void OnGestureEvent(Gesture gesture)
 {
     if (null == gesture)
     {
         return;
     }
     UnityEngine.Vector3 target_pos = gesture.GetStartTouchToWorldPoint();
     if (null != gesture.Recognizer && UnityEngine.Vector3.zero != target_pos)
     {
         if ("OnDoubleTap" == gesture.Recognizer.EventMessageName &&
             gesture.SelectedID < 0)
         {
             GfxModule.Skill.GfxSkillSystem.Instance.StopAttack(ArkCrossEngine.LogicSystem.PlayerSelf);
             //GfxModule.Skill.GfxSkillSystem.Instance.PushSkill(ArkCrossEngine.LogicSystem.PlayerSelf, SkillCategory.kRoll, target_pos);
             return;
         }
     }
     if (SkillCategory.kNone != gesture.SkillTags)
     {
         switch (gesture.SkillTags)
         {
         case SkillCategory.kSkillA:
         case SkillCategory.kSkillB:
         case SkillCategory.kSkillC:
         case SkillCategory.kSkillD:
         case SkillCategory.kSkillQ:
         case SkillCategory.kSkillE:
             GfxModule.Skill.GfxSkillSystem.Instance.StopAttack(ArkCrossEngine.LogicSystem.PlayerSelf);
             if (gesture.SectionNum > 0)
             {
                 if (waite_skill_buffer.Count > 0)
                 {
                     CandidateSkillInfo candidate_skill_info = new CandidateSkillInfo();
                     candidate_skill_info.skillType = gesture.SkillTags;
                     candidate_skill_info.targetPos = UnityEngine.Vector3.zero;
                     waite_skill_buffer.Add(candidate_skill_info);
                 }
                 else
                 {
                     GfxModule.Skill.GfxSkillSystem.Instance.PushSkill(ArkCrossEngine.LogicSystem.PlayerSelf, gesture.SkillTags, UnityEngine.Vector3.zero);
                 }
             }
             else
             {
                 waite_skill_buffer.Clear();
                 CandidateSkillInfo candidate_skill_info = new CandidateSkillInfo();
                 candidate_skill_info.skillType = gesture.SkillTags;
                 candidate_skill_info.targetPos = target_pos;
                 waite_skill_buffer.Add(candidate_skill_info);
                 GestureArgs e = TouchManager.ToGestureArgs(gesture);
                 LogicSystem.FireGestureEvent(e);
             }
             break;
         }
     }
 }
Beispiel #5
0
    public static void FireEvent(FingerEvent eventData)
    {
        if (!TouchEnable)
        {
            return;
        }

        GestureArgs e = ToGestureArgs(eventData);

        LogicSystem.FireGestureEvent(e);

        if (OnFingerEvent != null)
        {
            OnFingerEvent(eventData);
        }

        //Debug.LogWarning("...input event : " + eventData.Name + ", State : " + curTouchState.ToString());
    }
Beispiel #6
0
    public static void FireEvent(FingerEvent eventData)
    {
        if (!TouchEnable)
        {
            return;
        }

        int scene_id = WorldSystem.Instance.GetCurSceneId();

        if (scene_id > 0)
        {
            GestureArgs e = ToGestureArgs(eventData);
            LogicSystem.FireGestureEvent(e);
        }

        if (OnFingerEvent != null)
        {
            OnFingerEvent(eventData);
        }

        //Debug.LogWarning("...input event : " + eventData.Name + ", State : " + curTouchState.ToString());
    }
Beispiel #7
0
    private void TriggerMove(MovingJoystick move, bool isLift)
    {
        if (isLift)
        {
            GestureArgs e = new GestureArgs();
            e.name           = "OnSingleTap";
            e.airWelGamePosX = 0f;
            e.airWelGamePosY = 0f;
            e.airWelGamePosZ = 0f;
            e.selectedObjID  = -1;
            LogicSystem.FireGestureEvent(e);
            return;
        }

        GameObject playerSelf = LogicSystem.PlayerSelf;

        if (playerSelf != null && move.joystickAxis != Vector2.zero)
        {
            Vector2 joyStickDir = move.joystickAxis * 10.0f;
            Vector3 targetRot   = new Vector3(joyStickDir.x, 0, joyStickDir.y);
            Vector3 targetPos   = playerSelf.transform.position + targetRot;

            GestureArgs e = new GestureArgs();
            e.name           = "OnSingleTap";
            e.selectedObjID  = -1;
            e.towards        = Mathf.Atan2(targetPos.x - playerSelf.transform.position.x, targetPos.z - playerSelf.transform.position.z);
            e.airWelGamePosX = targetPos.x;
            e.airWelGamePosY = targetPos.y;
            e.airWelGamePosZ = targetPos.z;
            LogicSystem.FireGestureEvent(e);
            CurDirection = e.towards;
            ///
            if (null != OnJoystickMove)
            {
                OnJoystickMove(e.towards);
            }
        }
    }