Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Universal/package samples #2773

Merged
merged 54 commits into from
Apr 23, 2021
Merged

Universal/package samples #2773

merged 54 commits into from
Apr 23, 2021

Conversation

Jonasmortensen
Copy link
Contributor

@Jonasmortensen Jonasmortensen commented Nov 27, 2020


Purpose of this PR

The Unity Package Manager allows for samples to be bundled with a package. These samples can then optionally be imported from the editor. This has yet to be utilised by URP which this PR changes. This collection of samples each show different aspects of URP. They are not meant to be exhaustive and will be expanded as needed.

image


Comments to reviewers

The samples can be imported from the package manager when the URP package is selected. Please inspect the samples and see if the file structure, provided text and general set up makes sense.

@Jonasmortensen Jonasmortensen marked this pull request as ready for review February 15, 2021 10:08
@Jonasmortensen Jonasmortensen requested a review from a team as a code owner February 15, 2021 10:08
@ellioman ellioman self-requested a review April 7, 2021 13:25
Copy link
Contributor

@svens-unity svens-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reviewed the .cs scripts. Overall, it seems like it would be much less risk if we can find an existing movement controller. This should also bring less work for us in the future. All fields are public just to assign values in the inspector, consider using [SerializeField] and private fields instead.

}
direction = direction.normalized;

rb.AddForce((direction * walkSpeed) - rb.velocity, ForceMode.VelocityChange);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are taking away any force the controller has from previous frames? Does this take away gravity too? Wouldnt RigidBody.MovePosition() be more suitable for this behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the impression that RigidBody.MovePosition() was for manipulating kinematic bodies, which the player rigidbody is not.

@ellioman ellioman removed their request for review April 7, 2021 20:51
Copy link
Contributor

@Verasl Verasl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


void Update()
{
transform.position = m_StartPosition + m_Amplitude * Mathf.Sin(Time.time * Mathf.PI * (2/m_Period));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
transform.position = m_StartPosition + m_Amplitude * Mathf.Sin(Time.time * Mathf.PI * (2/m_Period));
transform.position = m_StartPosition + m_Amplitude * Mathf.Sin(Time.time * Mathf.PI * (2f / m_Period));

forward = forward.normalized;

Vector3 right = transform.right;
right.y = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
right.y = 0;
right.y = 0f;

forward.y = 0f;
forward = forward.normalized;
Vector3 right = transform.right;
right.y = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
right.y = 0;
right.y = 0f;

Copy link
Contributor

@svens-unity svens-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good now 👍

Spoke with Andre and he will have a quick look at the controller still. Other than that it looks good to go.

@phi-lira
Copy link
Contributor

Cancelled SplitJobs, VFX and Shader as this PR only addes samples. So can't affect those graphics tests.

@phi-lira phi-lira merged commit a01bdc7 into master Apr 23, 2021
@phi-lira phi-lira deleted the universal/package-samples branch April 23, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants