1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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<Regist> RegistList;
- #endregion
- private void Awake()
- {
- RegistList = new List<Regist>();
- if (Bundle.Instance == null)
- {
- gameObject.AddScript<Bundle>();
- }
- if (Auxiliary.Instance == null)
- {
- gameObject.AddScript<Auxiliary>();
- }
- gameObject.AddScript<ManaReso>();
- gameObject.AddScript<ManaAnim>();
- gameObject.AddScript<ManaAudio>();
- gameObject.AddScript<ManaUI>();
- gameObject.AddScript<ManaGarden>();
- gameObject.AddScript<ManaData>();
- gameObject.AddScript<ManaPlayer>();
- gameObject.AddScript<ManaDebug>();
- gameObject.AddScript<ManaMiniGame>();
- StartCoroutine(IInitialize());
- }
- public static void Initialize()
- {
- for (int i = 0; i < RegistList.Count; i++)
- {
- RegistList[i].Instantiate();
- RegistList[i].enabled = true;
- }
- 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();
- }
- //Bundle.UI.Unload(true);
- //Bundle.Skill.Unload(true);
- //Bundle.Config.Unload(true);
- //Bundle.Object.Unload(true);
- //Bundle.Shader.Unload(true);
- //Bundle.Garden.Unload(true);
- //Bundle.Character.Unload(true);
- }
- public IEnumerator IInitialize()
- {
- while (Bundle.LoadComplete == false)
- {
- yield return null;
- }
- Initialize();
- }
- }
|