private static IEnumerator AsyncLoadModel(ObjectModel model) { yield return(null); AsyncLoadRequest request; if (!string.IsNullOrEmpty(model.ModelCfg.ModelPath)) { request = XYSingleAssetLoader.AsyncLoad(model.ModelCfg.ModelPath, null, null); while (!request.isDone) { yield return(null); } model.GameObject = request.asset as GameObject; model.GameObject.name = model.ModelCfg.EquipName; } //特效 foreach (EffectConfig effectInfo in model.ModelCfg.Effects.Where(effectInfo => !string.IsNullOrEmpty(effectInfo.EffectAssetPath))) { request = XYSingleAssetLoader.AsyncLoad(effectInfo.EffectAssetPath, null, null); while (!request.isDone) { yield return(null); } model.EffectObjects.Add(request.asset as GameObject); } model.LoadOver(); }
private void Awake() { Instance_ = this; /*Thread t = new Thread( LoadingThread ); * t.Priority = System.Threading.ThreadPriority.BelowNormal; * t.Start(); * this.StartCoroutine( CreateAssetFromMemory() );*/ }
private void Init() { XYDirectory.Init(); XYCoroutineEngine.Load(); XYSingleAssetLoader.Init(); Loader.Init(); TimelineManager.Init(); World.Init(); }
private static IEnumerator AsyncPreloadRoleBone(float Preloadpercent) { string[] files = Directory.GetFiles(@"res/model", "*.bone", SearchOption.AllDirectories); foreach (string file in files) { AsyncLoadRequest ar = XYSingleAssetLoader.AsyncPreload(file); while (!ar.isDone) { yield return(null); } } yield return(null); AsyncPreloadTotal += Preloadpercent; }
void Destroy() { UnityEngine.Object.Destroy(this.gameObject); Instance_ = null; }
void Start() { XYSingleAssetLoader.AsyncLoad(clippath, AnimationLoad, null); transform_ = this.transform; }
private void Init() { XYDirectory.Init(); XYCoroutineEngine.Load(); XYSingleAssetLoader.Init(); }