mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2025-10-29 12:22:07 +01:00
Added RotateBuildings
This commit is contained in:
@@ -69,6 +69,7 @@ public abstract class BuildingBlueprint : MonoBehaviour
|
|||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Collinding Callbacks
|
||||||
if (isColliding)
|
if (isColliding)
|
||||||
{
|
{
|
||||||
WhileColliding();
|
WhileColliding();
|
||||||
@@ -77,6 +78,44 @@ public abstract class BuildingBlueprint : MonoBehaviour
|
|||||||
{
|
{
|
||||||
WhileNotColliding();
|
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