Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
curvedflats
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Flatland
curvedflats
Commits
8e04a34d
Commit
8e04a34d
authored
5 years ago
by
Chae Ho Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare for model-ui integration
parent
485cb407
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
PathRenderer.cs
Assets/Scripts/PathRenderer.cs
+10
-0
PlayerMovement.cs
Assets/Scripts/PlayerMovement.cs
+1
-1
No files found.
Assets/Scripts/PathRenderer.cs
View file @
8e04a34d
...
...
@@ -11,6 +11,8 @@ public class PathRenderer : MonoBehaviour
Square
square
;
[
SerializeField
]
GameObject
PathColliderPrefab
;
[
SerializeField
]
Camera
playercamera
;
LineRenderer
_pathRenderer
;
float
_originalPathColliderY
;
...
...
@@ -31,6 +33,14 @@ public class PathRenderer : MonoBehaviour
RaycastHit
hit
;
var
ray
=
Camera
.
main
.
ScreenPointToRay
(
Input
.
mousePosition
);
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
{
ray
=
playercamera
.
ViewportPointToRay
(
hit
.
textureCoord
);
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
{
// hit should now contain information about what was hit through secondCamera
}
}
if
(
Physics
.
Raycast
(
ray
,
out
hit
))
{
if
(
Input
.
GetKey
(
KeyCode
.
LeftShift
))
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/PlayerMovement.cs
View file @
8e04a34d
...
...
@@ -35,7 +35,7 @@ public class PlayerMovement : MonoBehaviour
//transform.Translate(0.5f*Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480) * Time.fixedDeltaTime, Space.World);
//v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
v
=
alpha
.
normalized
*
(
alpha
.
magnitude
*
Time
.
time
/
Mathf
.
Sqrt
(
1.0f
+
(
alpha
.
magnitude
*
Time
.
time
)
*
(
alpha
.
magnitude
*
Time
.
time
)));
//
v = alpha.normalized * (alpha.magnitude * Time.time / Mathf.Sqrt(1.0f + (alpha.magnitude * Time.time) * (alpha.magnitude * Time.time)));
beta
=
v
.
magnitude
/
1.0f
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment