using UnityEngine.UI; using UnityEngine; namespace InterfaceOff { public class ImageWindow : WindowBase { private static Vector3[] Positions = { new(-45, 25f), new(45f, 25f), new(-45, -65), new(45f, -65) }; private int m_TilesRotatedCorrectly; public override void OnWindowInstantiation() { /* Lets the player know what to do via text */ Components.InfoText.text = "Rotate"; /* Creates the images to rotate */ Sprite[] sprites = CanvasManager.Instance.Images.GetRandomSpriteSet(); for (int i = 0; i < 4; i++) { /* Fetches/Creates needed components */ GameObject go = Instantiate(CanvasManager.Instance.ImagePrefab, transform); RectTransform t = go.GetComponent(); t.sizeDelta = new Vector2(80, 80); t.localPosition = Positions[i]; t.eulerAngles = new Vector3(0, 0, Random.Range(1, 4) * 90); Image img = go.GetComponent(); img.material = new Material(Shader.Find("UI/Default")); img.sprite = sprites[i]; /* Adds a function to the buttons for them to rotate */ Button button = go.GetComponent