Commit 8e04a34d authored by Chae Ho Shin's avatar Chae Ho Shin

Prepare for model-ui integration

parent 485cb407
...@@ -11,6 +11,8 @@ public class PathRenderer : MonoBehaviour ...@@ -11,6 +11,8 @@ public class PathRenderer : MonoBehaviour
Square square; Square square;
[SerializeField] [SerializeField]
GameObject PathColliderPrefab; GameObject PathColliderPrefab;
[SerializeField]
Camera playercamera;
LineRenderer _pathRenderer; LineRenderer _pathRenderer;
float _originalPathColliderY; float _originalPathColliderY;
...@@ -31,6 +33,14 @@ public class PathRenderer : MonoBehaviour ...@@ -31,6 +33,14 @@ public class PathRenderer : MonoBehaviour
RaycastHit hit; RaycastHit hit;
var ray = Camera.main.ScreenPointToRay(Input.mousePosition); 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 (Physics.Raycast(ray, out hit))
{ {
if (Input.GetKey(KeyCode.LeftShift)) if (Input.GetKey(KeyCode.LeftShift))
......
...@@ -35,7 +35,7 @@ public class PlayerMovement : MonoBehaviour ...@@ -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); //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 = (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; beta = v.magnitude / 1.0f;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment