Commit 64a65eca authored by 16이진형's avatar 16이진형

더블클릭시 무한히 진행

parent 6005c77b
...@@ -142,32 +142,42 @@ public class FlatlandMovement : MonoBehaviour ...@@ -142,32 +142,42 @@ public class FlatlandMovement : MonoBehaviour
/// </summary> /// </summary>
/// <param name="path">목적지 x z 가 공간</param> /// <param name="path">목적지 x z 가 공간</param>
/// <param name="v">속력 0<v<1</param> /// <param name="v">속력 0<v<1</param>
public bool MoveTo(Vector3 dest, float v) public bool MoveToAbPosition(Vector3 dest, float v)
{ {
dest.y = 0; bool result = SetVelecityToAbPosition(dest, v);
Debug.Log("bb"); if (!result)
Debug.Log(dest);
if (v < 0.0001f)
{ {
//v가 0일때.
return false; return false;
} }
nowDest = dest;
isAutoMove = true;
return true;
}
/// <summary>
/// 절대좌표 방향으로 무한히 날아갑니다
/// </summary>
/// <param name="dest"></param>
/// <param name="v"></param>
/// <returns></returns>
public bool MoveInfinitelyToAbPosition(Vector3 dest, float v)
{
return SetVelecityToAbPosition(dest,v);
}
public bool SetVelecityToAbPosition(Vector3 dest, float v)
{
dest.y = 0;
//속도와 목적지 설정. //속도와 목적지 설정.
Vector3 tmp = dest-transform.position; Vector3 tmp = dest - transform.position;
Debug.Log("move vector: " + tmp);
tmp.y = 0; tmp.y = 0;
this.v = tmp.normalized * v * (float)Constants.c; this.v = tmp.normalized * v * (float)Constants.c;
Debug.Log("v : "+ this.v);
this.nowDest = dest;
isAutoMove = true;
return true; return true;
} }
private void NextMove() private void NextMove()
{ {
MoveTo(dests[0], pathVelocitys[0]); MoveToAbPosition(dests[0], pathVelocitys[0]);
dests.RemoveAt(0); dests.RemoveAt(0);
pathVelocitys.RemoveAt(0); pathVelocitys.RemoveAt(0);
......
...@@ -260,7 +260,8 @@ public class UIManager : MonoBehaviour ...@@ -260,7 +260,8 @@ public class UIManager : MonoBehaviour
ray = playercamera.ViewportPointToRay(hit.textureCoord); ray = playercamera.ViewportPointToRay(hit.textureCoord);
if (Physics.Raycast(ray, out hit)) if (Physics.Raycast(ray, out hit))
{ {
levelManager.player.MoveTo(hit.point, velocityslider.GetLogScaleValue()); levelManager.player.MoveInfinitelyToAbPosition(hit.point, velocityslider.GetLogScaleValue());
//levelManager.player.MoveToAbPosition(hit.point, velocityslider.GetLogScaleValue());
//Debug.Log(velocityslider.GetLogScaleValue() * (float)Constants.c); //Debug.Log(velocityslider.GetLogScaleValue() * (float)Constants.c);
//Debug.Log(hit.point); //Debug.Log(hit.point);
} }
......
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