mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2025-10-28 20:12:08 +01:00
Added RotateBuildings
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1
UserSettings/Search.settings
Normal file
1
UserSettings/Search.settings
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
Reference in New Issue
Block a user