Пример #1
0
    private void DelayExtraMove(int hitActionID)
    {
        SkillAction action     = SkillAction.dataMap[hitActionID];
        MotorParent theMotor   = owner.Motor;
        float       extraSpeed = action.extraSpeed;

        theMotor.SetExrtaSpeed(extraSpeed);
        theMotor.SetMoveDirection(owner.transform.forward);
        TimerHeap.AddTimer <MotorParent>((uint)action.extraSl, 0, (m) => { m.SetExrtaSpeed(0); }, theMotor);
    }
Пример #2
0
    private void AttackingMove(SkillAction action)
    {
        MotorParent theMotor = owner.Motor;

        if (theMotor == null)
        {
            return;
        }
        float extraSpeed = action.extraSpeed;

        if (extraSpeed != 0)
        {
            if (action.extraSt <= 0)
            {
                theMotor.SetExrtaSpeed(extraSpeed);
                theMotor.SetMoveDirection(owner.transform.forward);
                TimerHeap.AddTimer <MotorParent>((uint)action.extraSl, 0, (m) => { m.SetExrtaSpeed(0); }, theMotor);
            }
            else
            {
                TimerHeap.AddTimer <int>((uint)action.extraSt, 0, DelayExtraMove, action.id);
            }
        }
        else
        {
            theMotor.SetExrtaSpeed(0);
        }

        // 是否允许,在技能过程中使用 摇杆改变方向
        //if (theOwner is EntityMyself)
        //{
        //    theMotor.enableStick = action.enableStick > 0;
        //}

        if (action.teleportDistance > 0 && extraSpeed <= 0)
        {
            Vector3 dst = Vector3.zero;
            dst = owner.transform.position + owner.transform.forward * action.teleportDistance;
            theMotor.TeleportTo(dst);
        }
    }