using System; using System.Collections.Generic; using UnityEngine; public class UpdateWindowSystem : MonoBehaviour { [Serializable] public class NewsClass { public Sprite image; public string title; public string contnet; } [SerializeField] private GameObject newWindowPrefab; public List classList; private int startIndex; public void ShowUpdate() { NewsItem component = UnityEngine.Object.Instantiate(newWindowPrefab, UnityEngine.Object.FindObjectOfType().gameObject.transform).GetComponent(); component.image = classList[startIndex].image; component.title = classList[startIndex].title; component.content = classList[startIndex].contnet; component.actualIndex = startIndex; component.listSize = classList.Count; component.updateWindowSystem = this; } }