コード例 #1
0
ファイル: BallPhysics.cs プロジェクト: yaokailing/HoloInOne
    // Pushes the ball in the direction of the ray from the camera to the ball's position
    public void PushBall(float forcePower = 20)
    {
        Debug.Log("Pushing Ball");
        var rigidbody = getRigidBody();

        var ray = ballControl.GetRayCameraToBall();

        rigidbody.AddForce(forcePower * (ray.direction));
    }