예제 #1
0
    void FixedUpdate()
    {
        movingSpeed = Input.GetAxis("Horizontal");
        if (charstage == 0)
        {
            character.Move(movingSpeed, jump);
        }
        else
        {
            character.Move(0, jump);
        }

        //jump is reset after each time that physical engine updated
        jump = false;
    }
    private void FixedUpdate()
    {
        // Read the inputs.
        // bool crouch = Input.GetKey(KeyCode.LeftControl);
        // float h = CrossPlatformInputManager.GetAxis("Horizontal");

        // Pass all parameters to the character control script.
        character.Move(jump);
        jump = false;
    }
    private void Update()
    {
        m_Jump  = CrossPlatformInputManager.GetButtonDown("Jump");
        m_Climb = CrossPlatformInputManager.GetButton("Fire2");
        float h = CrossPlatformInputManager.GetAxis("Horizontal");
        float v = CrossPlatformInputManager.GetAxis("Vertical");

        // Pass all parameters to the character control script.
        m_Character.Move(h, v, m_Climb, m_Jump);
    }
예제 #4
0
    private void FixedUpdate()
    {
        // Read the inputs.
        bool  crouch = Input.GetKey(KeyCode.LeftControl);
        float h      = Input.GetAxis(horizontalAxis);

        // Pass all parameters to the character control script.
        m_Character.Move(h, crouch, m_Jump);
        m_Jump = false;
    }
예제 #5
0
    void FixedUpdate()
    {
        //get input by Axis set in input setting
        movingSpeed = Input.GetAxis("Horizontal");

        //pass parameters to character script, and then it can move
        character.Move(movingSpeed, jump);

        //jump is reset after each time that physical engine updated
        jump = false;
    }
예제 #6
0
    // Update is called once per frame
    void FixedUpdate()
    {
        float direction = Input.GetAxis("Horizontal");

        character.Move(direction);
        if (m_Jump)
        {
            character.Jump();
            m_Jump = false;
        }
    }
예제 #7
0
    // Update is called once per frame
    void Update()
    {
        var side    = Input.GetAxisRaw("Horizontal");
        var forward = Input.GetAxisRaw("Vertical");

        if (Input.GetKeyDown(KeyCode.E))
        {
            interactTrigger.Invoke();
        }
        if (Input.GetKeyDown(KeyCode.Q))
        {
            hackTrigger.Invoke();
        }
        character.Move(side, forward);
    }
예제 #8
0
    void FixedUpdate()
    {
        // Read the inputs.
        bool crouch = Input.GetKey(KeyCode.LeftControl);

                #if CROSS_PLATFORM_INPUT
        float h = CrossPlatformInput.GetAxis("Horizontal");
                #else
        float h = Input.GetAxis("Horizontal");
                #endif

        // Pass all parameters to the character control script.
        character.Move(h, crouch, jump);

        // Reset the jump input once it has been used.
        jump = false;
    }
예제 #9
0
파일: Drop.cs 프로젝트: OIIOIIOI/CNXProto01
    void FixedUpdate()
    {
        character.Move(moveVector * Time.deltaTime);

        if (alive && Physics2D.IsTouching(dropCollider, contactFilter))
        {
            Collider2D[] targets = new Collider2D[1];
            Physics2D.GetContacts(dropCollider, contactFilter, targets);
            if (targets.Length > 0)
            {
                Collider2D coll = targets[0];
                switch (coll.tag)
                {
                case "Player":
                    Player.Players p = coll.gameObject.GetComponent <Player>().playerChoice;
                    GM.ScorePoints(p, 15);
                    break;

                default:
                    break;
                }
            }

            alive = false;

            Rigidbody2D rb = GetComponent <Rigidbody2D>();
            rb.simulated = false;

            dropCollider.enabled   = false;
            spriteRenderer.enabled = false;

            if (pickupParticles != null)
            {
                Vector3 spawn = transform.position;
                spawn.z = -1f;
                GameObject b = GameObject.Instantiate(pickupParticles, spawn, Quaternion.identity);
            }

            DieForReal();
        }
    }
예제 #10
0
    void FixedUpdate()
    {
        if (isPaused)
        {
            return;
        }

        Vector3 lookPos;     //The position that the character should be looking towards
        Vector3 move;        //the world-relative desired move direction, calculated from the lookAtTarget and user input, and then the characterScriptControl
        bool    jump;



        userControl.solveInput(playerNumber, transform, looksAtTarget, lookAtTarget,
                               out lookPos, out move, out jump);


        bool onGround;

        character.Move(lookPos, move, jump, out onGround);

        scriptControl.rubberBanding(transform, playerIsAttachedTo, onGround);
    }
 void FixedUpdate()
 {
     character.Move(horizontalMove * Time.fixedDeltaTime);
 }
예제 #12
0
 void FixedUpdate()
 {
     character.Move(moveVector * Time.deltaTime);
 }
예제 #13
0
 void FixedUpdate()
 {
     movingSpeed = Input.GetAxis("Horizontal");
     character.Move(movingSpeed, jump);
     jump = false;
 }