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

이동 기능 온오프

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