Esempio n. 1
0
    public override void execute()
    {
        CharacterMyself myself = mCharacterManager.getMyself();

        // 速度
        if (myself != null && myself.getProcessExternalSpeed())
        {
            CommandCharacterHardwareSpeed cmdSpeed = newCmd(out cmdSpeed, false);
            cmdSpeed.mDirectSpeed   = false;
            cmdSpeed.mExternalSpeed = true;
            if (GameUtility.mReadRPM)
            {
                cmdSpeed.mSpeed = GameUtility.HWSToMS(mRPM);
            }
            else
            {
                cmdSpeed.mSpeed = GameUtility.HWSToMS(mPower);
            }
            pushCommand(cmdSpeed, mCharacterManager.getMyself());
        }
        // 按键
        KeyCode[] key   = new KeyCode[] { KeyCode.A, KeyCode.B, KeyCode.X, KeyCode.Y };
        int       count = key.Length;

        for (int i = 0; i < count; ++i)
        {
            mGameInputManager.setKeyState(key[i], isKeyDown(i));
        }
        // 转向
        mGameInputManager.setStickAngle(mAngle);
        if (mScriptDebugInfo != null)
        {
            mScriptDebugInfo.setOrginStackAngle(mAngle);
            mScriptDebugInfo.setRPM(mRPM);
            mScriptDebugInfo.setPower(mPower);
        }
    }