This commit is contained in:
Janis
2022-06-03 22:53:35 +02:00
parent 87d77d2867
commit a31c6a16dd
21 changed files with 1005 additions and 7 deletions

View File

@@ -17,9 +17,7 @@ public class PlayerController : MonoBehaviour
// demolish
if (Input.GetButtonDown("Demolish"))
{
Debug.Log("Demolish");
demolishMode = !demolishMode;
movingMode = false;
ToggleDemolishMode();
}
if (demolishMode && Input.GetMouseButton(0) && MenuManager.AllMenusClosed())
@@ -31,9 +29,7 @@ public class PlayerController : MonoBehaviour
// moving
if (Input.GetButtonDown("Move"))
{
Debug.Log("Move");
movingMode = !movingMode;
demolishMode = false;
ToggleMovingMode();
}
if (movingMode && Input.GetMouseButtonDown(0) && MenuManager.AllMenusClosed())
@@ -44,4 +40,18 @@ public class PlayerController : MonoBehaviour
movingMode = false;
}
}
public void ToggleDemolishMode()
{
Debug.Log("Demolish");
demolishMode = !demolishMode;
movingMode = false;
}
public void ToggleMovingMode()
{
Debug.Log("Move");
movingMode = !movingMode;
demolishMode = false;
}
}