-
Notifications
You must be signed in to change notification settings - Fork 792
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
Conversation
# Conflicts: # com.unity.render-pipelines.universal/package.json
...ty.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/FPSController.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/Rotator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
com.unity.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/SineMover.cs
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/SineMover.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/SineMover.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/SineMover.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/Rotator.cs
Outdated
Show resolved
Hide resolved
...ty.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/FPSController.cs
Outdated
Show resolved
Hide resolved
...ty.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/FPSController.cs
Outdated
Show resolved
Hide resolved
...ty.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/FPSController.cs
Outdated
Show resolved
Hide resolved
...y.render-pipelines.universal/Samples~/TeachingSamples/SharedAssets/Scripts/MobileControls.cs
Outdated
Show resolved
Hide resolved
} | ||
direction = direction.normalized; | ||
|
||
rb.AddForce((direction * walkSpeed) - rb.velocity, ForceMode.VelocityChange); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right.y = 0; | |
right.y = 0f; |
forward.y = 0f; | ||
forward = forward.normalized; | ||
Vector3 right = transform.right; | ||
right.y = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right.y = 0; | |
right.y = 0f; |
There was a problem hiding this 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.
Cancelled SplitJobs, VFX and Shader as this PR only addes samples. So can't affect those graphics tests. |
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.
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.