コード例 #1
0
ファイル: Player.cs プロジェクト: turbomates/gop-jumper
    private void Update()
    {
        game.UpdatePlayerProgress(transform.position.y);

        Quaternion rotation = transform.rotation;

        rotation.z         = rb.velocity.x * -0.01f;
        transform.rotation = rotation;

        if (isOnPlatform)
        {
            if (Input.GetMouseButtonDown(0) && !IsPointerOverGameObject() && powerGameObject == null && needleGameObject != null)
            {
                StopNeedle();
                jumper.AnimateSit();
                InstantiatePower();
            }
            else if (Input.GetMouseButtonUp(0) && powerGameObject != null)
            {
                Power power = powerGameObject.GetComponent <Power>();
                power.Stop();
                float force = power.GetCurrentForce();
                Jump(force);
            }
        }

        jumper.AnimateReposition(rb.velocity.y);
    }