I want all my images on a canvas to rotate 180 degrees when the turn ends but I dont want to choose what cards chnage based on Tags because I needs those for later use, I put a script on all the cards called “PlayingCard” and this is my script currently:
public class EndTurn : MonoBehaviour
{
// public PlayingCard GameCards;
private void Start()
{
}
private void Update()
{
//GameCards = GetComponentsInChildren<RectTransform>();
}
private void OnGUI()
{
if (GUI.Button(new Rect(650, 10, 100, 20), "End Turn"))
{
PlayingCard[] GameCards = FindObjectsOfType(typeof(PlayingCard)) as PlayingCard[];
foreach (PlayingCard component in GameCards)
{
// RectTransform rectTransform = GetComponent<RectTransform>();
transform.Rotate(new Vector3(0, 0, 45));
}
}
}
}