Пример #1
0
    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();
    }
Пример #2
0
    private void Awake()
    {
        Instance_ = this;

        /*Thread t = new Thread( LoadingThread );
         * t.Priority = System.Threading.ThreadPriority.BelowNormal;
         * t.Start();
         * this.StartCoroutine( CreateAssetFromMemory() );*/
    }
Пример #3
0
 private void Init()
 {
     XYDirectory.Init();
     XYCoroutineEngine.Load();
     XYSingleAssetLoader.Init();
     Loader.Init();
     TimelineManager.Init();
     World.Init();
 }
Пример #4
0
    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;
    }
Пример #5
0
 void Destroy()
 {
     UnityEngine.Object.Destroy(this.gameObject);
     Instance_ = null;
 }
Пример #6
0
 void Start()
 {
     XYSingleAssetLoader.AsyncLoad(clippath, AnimationLoad, null);
     transform_ = this.transform;
 }
Пример #7
0
 private void Init()
 {
     XYDirectory.Init();
     XYCoroutineEngine.Load();
     XYSingleAssetLoader.Init();
 }