using System.Collections; using System.Collections.Generic; using UnityEngine; public class CharacterScreenPortalAnim : MonoBehaviour { public List idlePortals = new List(); public List closePortals = new List(); public List characters = new List(); private void Awake() { for (int i = 0; i < idlePortals.Count; i++) { idlePortals[i].SetActive(true); closePortals[i].SetActive(false); } for (int i = 0; i < characters.Count; i++) { characters[i].SetActive(false); } } // Start is called before the first frame update void Start() { Invoke(nameof(ClosePortals), 0.25f); } private void ClosePortals() { for (int i = 0; i < idlePortals.Count; i++) { closePortals[i].SetActive(true); idlePortals[i].SetActive(false); } for (int i = 0; i < characters.Count; i++) { characters[i].SetActive(true); } Invoke(nameof(HidePortalsCompletely), 1f); } private void HidePortalsCompletely() { for (int i = 0; i < closePortals.Count; i++) { closePortals[i].SetActive(false); } } }