Removed uneeded close buttons
This commit is contained in:
@@ -17,6 +17,9 @@ namespace InterfaceOff
|
||||
|
||||
protected override void OnWindowInstantiation()
|
||||
{
|
||||
/* Destroys the Window Close button to stop accidental clicking */
|
||||
Destroy(Components.CloseButtonRectTransform.gameObject);
|
||||
|
||||
/* Lets the player know what to do via text */
|
||||
Components.InfoText.text = "Rotate";
|
||||
|
||||
@@ -40,8 +43,8 @@ namespace InterfaceOff
|
||||
Button button = go.GetComponent<Button>();
|
||||
button.onClick.AddListener(() =>
|
||||
{
|
||||
/* Updates the rotation of the clicked image */
|
||||
RectTransform rect = button.GetComponent<RectTransform>();
|
||||
|
||||
if (!(rect.rotation.eulerAngles.z < 45 && rect.rotation.eulerAngles.z > -45))
|
||||
{
|
||||
Vector3 rot = rect.rotation.eulerAngles;
|
||||
@@ -50,21 +53,20 @@ namespace InterfaceOff
|
||||
rect.rotation = Quaternion.Euler(rot);
|
||||
}
|
||||
|
||||
/* Stops further rotation if it is the correct orientation */
|
||||
if (rect.rotation.eulerAngles.z < 45 && rect.rotation.eulerAngles.z > -45)
|
||||
{
|
||||
m_TilesRotatedCorrectly++;
|
||||
button.interactable = false;
|
||||
}
|
||||
|
||||
/* Closes the window if they are all finished */
|
||||
if (m_TilesRotatedCorrectly == 4)
|
||||
{
|
||||
DestroyWindow();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnWindowCloseButtonClicked()
|
||||
{
|
||||
if (m_TilesRotatedCorrectly == 4)
|
||||
{
|
||||
DestroyWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user