Esempio n. 1
0
        private void Execute_KeyEvent()
        {
            if (LeftKey.CheckEvent() || RightKey.CheckEvent())
            {
                return;
            }

            if (Input.GetMouseButtonDown(0))
            {
                paramData.SetString("100101");
                GameLocate.PushInputAction(Com.InputAction.Skill, paramData);
            }
            else
            {
                Input.GetKeyDown(KeyCode.A);
                Vector2 move = Vector2.zero;
                move.x = Input.GetAxisRaw("Horizontal");
                if (Input.GetButtonDown("Jump"))
                {
                    move.y = 1;
                }

                paramData.SetVect2(move);
                GameLocate.PushInputAction(Com.InputAction.Move, paramData);
            }
        }
Esempio n. 2
0
    void Update()
    {
        LeftKey.CheckEvent();
        RightKey.CheckEvent();


        Input.GetKeyDown(KeyCode.A);
        Vector2 move = Vector2.zero;

        move.x = Input.GetAxisRaw("Horizontal");
        if (Input.GetButtonDown("Jump"))
        {
            move.y = 1;
        }

        paramData.SetVect2(move);
        ECSLocate.Player.PushPlayerReq(RequestId.Move, paramData);


        if (Input.GetMouseButtonDown(0))
        {
            paramData.SetString("100101");
            ECSLocate.Player.PushPlayerReq(RequestId.PushSkill, paramData);
        }
    }
Esempio n. 3
0
        protected void ComputeVelocity()
        {
            #region 点击加速
            // Vector2 move=Vector2.zero;
            // if (Input.GetKeyDown(KeyCode.A))
            // {
            //     move.x = 1;
            // }
            // if (Input.GetButtonDown("Jump"))
            // {
            //     move.y = 1;
            // }

            // ParamData paramData = ECSLocate.Player.GetReqParam(EntityReqId.PlayerMove);
            // paramData.SetVect2(move);
            // ECSLocate.Player.PushPlayerReq(EntityReqId.PlayerMove);

            #endregion

            #region  键速度

            Vector2 move = Vector2.zero;
            bool    dash = false;

            move.x = Input.GetAxisRaw("Horizontal");

            if (Input.GetButtonDown("Jump"))
            {
                move.y = 1;
            }

            if (Input.GetMouseButtonDown(0))
            {
                dash = true;
            }

            ParamData paramData = ECSLocate.Player.GetReqParam(EntityReqId.PlayerMove);
            paramData.SetVect2(move);
            paramData.SetBool(dash);
            ECSLocate.Player.PushPlayerReq(EntityReqId.PlayerMove);

            #endregion
        }
Esempio n. 4
0
        protected override void OnEnter(NodeData wData)
        {
            if (!wData.Blackboard.ContainsKey(DEC_PRE_CheckEnemyInAttackRange.EnemyInAttackRangeKey))
            {
                return;
            }

            GazeSurroundData context = GetContext <GazeSurroundData>(wData);

            context.Timer = NodeTime.TotalTime;

            int followEntityUid = (int)wData.Blackboard[DEC_PRE_CheckEnemyInAttackRange.EnemyInAttackRangeKey];

            paramData.SetInt(followEntityUid);
            paramData.SetVect2(gazeRange);

            EntityWorkData workData = wData as EntityWorkData;

            LCECS.ECSLayerLocate.Request.PushRequest(workData.MEntity.GetHashCode(), LCECS.RequestId.GazeSurround, paramData);
        }
Esempio n. 5
0
        private void Enter(NodeData wData)
        {
            EntityWorkData workData = wData as EntityWorkData;

            switch (inputCom.CurrAction)
            {
            case InputAction.None:
                break;

            case InputAction.Move:
                paramData.SetVect2(inputCom.Param.GetVect2());
                ECSLayerLocate.Request.PushRequest(workData.MEntity.GetHashCode(), RequestId.Move, paramData);
                return;

            case InputAction.Skill:
                paramData.SetString(inputCom.Param.GetString());
                ECSLayerLocate.Request.PushRequest(workData.MEntity.GetHashCode(), RequestId.PushSkill, paramData);
                return;

            default:
                break;
            }
        }