Skip to content

Commit

Permalink
添加一定的偏移确保初始时地面绘制正常
Browse files Browse the repository at this point in the history
  • Loading branch information
moshuying committed Jul 7, 2024
1 parent bc50dd6 commit d712761
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Rotation: 95.649025
- _Rotation: 2.4328818
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/MovingRoadController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ public class MovingRoadController : MonoBehaviour
[HideInInspector]
public float movingSpeed;

[HideInInspector]
public Vector3 offest = new Vector3(0,0,0);

private void Start()
{
offest = spawner.moveDirection * movingSpeed;
transform.Translate(offest * 20);
}
void Update()
{
transform.Translate(spawner.moveDirection * movingSpeed * Time.deltaTime);
Expand Down

0 comments on commit d712761

Please sign in to comment.