Commit b10d43a6 authored by 16이진형's avatar 16이진형

이동 기능 온오프

parent f54dd753
......@@ -11,14 +11,28 @@ public class LevelManager : MonoBehaviour
public PlayerMovement player;
[SerializeField]
protected bool winstate = false;
[SerializeField]
protected bool DoubleClickMove = true;
[SerializeField]
protected bool PathRanderMove = true;
[SerializeField]
protected bool WASDMove = true;
// Start is called before the first frame update
void Start()
protected virtual void Start()
{
winstate = false;
uiManager.WASDMove = WASDMove;
uiManager.PathCreateAble = PathRanderMove;
uiManager.DoubleCLickMove = DoubleClickMove;
}
// Update is called once per frame
void Update()
protected virtual void Update()
{
if (WinCondition())
{
......
......@@ -45,7 +45,7 @@ public class PlayerMovement : FlatlandMovement,IInteractor,IGraber
if (obj)
{
uiManager.InteractText = obj.InteractType;
uiManager.InteractText = "G:"+obj.InteractType;
}
else
{
......
......@@ -48,7 +48,7 @@ public class PathRenderer : MonoBehaviour
_pathRenderer = GetComponent<LineRenderer>();
_ResetPaths();
pathcreatable = true;
//pathcreatable = true;
}
// Update is called once per frame
......
......@@ -36,6 +36,9 @@ public class UIManager : MonoBehaviour
public float scrollSpeed = 1.0f;
public bool WASDMove = true;
public bool DoubleCLickMove = true;
private int prevSelectPathNum = -1;
private Text pathName;
private Text pathVelocity;
......@@ -120,9 +123,11 @@ public class UIManager : MonoBehaviour
cameraMovement.Size += scroll;
playerSquare.Scale = 1/cameraMovement.SizeScale;
//player movement
if (pathRenderer.pathcreatable)
if (WASDMove)
{
if (Input.GetKeyDown("w"))
{
......@@ -188,6 +193,14 @@ public class UIManager : MonoBehaviour
wintext.GetComponent<Text>().text = "Lose";
}
public bool PathCreateAble
{
set
{
pathRenderer.pathcreatable = value;
}
}
private void updatePathInfo(int pathNum)
{
pathName.text = "Path - " + pathNum;
......@@ -274,9 +287,10 @@ public class UIManager : MonoBehaviour
public void OnDoubleClicked()
{
try
{
if (levelManager.player.IsInertial && pathRenderer.pathcreatable)
if (levelManager.player.IsInertial && DoubleCLickMove)
{
RaycastHit hit;
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
......
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