using LitJson; using UnityEngine; using UnityEngine.EventSystems; using System; using System.Xml; using System.Collections; using System.Collections.Generic; public class Initializer : MonoBehaviour { #region public static List RegistList { get { if (_RegistList == null) { _RegistList = new List(); } return _RegistList; } set { _RegistList = value; } } public static List _RegistList; public static bool Tutorial; #endregion private void Awake() { if (Bundle.Instance == null) { gameObject.AddScript(); } if (Auxiliary.Instance == null) { gameObject.AddScript(); } gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); gameObject.AddScript(); StartCoroutine(IInitialize()); } public static void Initialize() { Tutorial = Data.PlayerBool("Tutorial"); if (Tutorial) { TutorialInitialize(); } else { RegularInitialize(); } } public static void TutorialInitialize() { for (int i = 0; i < RegistList.Count; i++) { RegistList[i].TutorialInstantiate(); } for (int i = 0; i < RegistList.Count; i++) { RegistList[i].TutorialRegistReference(); } for (int i = 0; i < RegistList.Count; i++) { RegistList[i].TutorialRegistValue(); RegistList[i].enabled = true; } } public static void RegularInitialize() { for (int i = 0; i < RegistList.Count; i++) { RegistList[i].Instantiate(); } for (int i = 0; i < RegistList.Count; i++) { RegistList[i].RegistReference(); } for (int i = 0; i < RegistList.Count; i++) { RegistList[i].RegistValueA(); } for (int i = 0; i < RegistList.Count; i++) { RegistList[i].RegistValueB(); } for (int i = 0; i < RegistList.Count; i++) { RegistList[i].RegistValueC(); RegistList[i].enabled = true; } } public IEnumerator IInitialize() { while (Bundle.LoadComplete == false) { yield return null; } Initialize(); } }