Added RotateBuildings

This commit is contained in:
DerTyp187
2021-10-01 20:47:43 +02:00
parent b7d092193a
commit aad300affd
2 changed files with 40 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ public abstract class BuildingBlueprint : MonoBehaviour
Destroy(this.gameObject);
}
//Collinding Callbacks
if (isColliding)
{
WhileColliding();
@@ -77,6 +78,44 @@ public abstract class BuildingBlueprint : MonoBehaviour
{
WhileNotColliding();
}
//Rotate
if (Input.GetButtonDown("Rotate"))
{
Debug.Log("Rotate+");
if (Input.GetKey(KeyCode.LeftShift))
{
transform.Rotate(0, 5, 0);
}else if (Input.GetKey(KeyCode.LeftControl))
{
transform.Rotate(0, 45, 0);
}
else
{
transform.Rotate(0, 22.5f, 0);
}
}
if (Input.GetButtonDown("CounterRotate"))
{
Debug.Log("Rotate-");
if (Input.GetKey(KeyCode.LeftShift))
{
transform.Rotate(0, -5, 0);
}else if (Input.GetKey(KeyCode.LeftControl))
{
transform.Rotate(0, -45, 0);
}
else
{
transform.Rotate(0, -22.5f, 0);
}
}
}
}

View File

@@ -0,0 +1 @@
{}