Exemplo n.º 1
0
    private void PreloadFX(ResWeight.ResType type)
    {
        if (ResWeight.IsLoadFinished(type))
        {
            this.JustLoadNextResource(ResWeight.ResType.none);
            return;
        }
        using (HashSet <int> .Enumerator enumerator = LoadingRes.m_load_fxIds.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                int current = enumerator.get_Current();
                Fx  fx      = DataReader <Fx> .Get(current);

                if (fx == null)
                {
                    this.LoadSuccessWithCheck(type);
                }
                else
                {
                    AssetManager.LoadAssetWithPool(fx.path, delegate(bool isSuccess)
                    {
                        this.LoadSuccessWithCheck(type);
                    });
                }
            }
        }
    }
Exemplo n.º 2
0
    public static void LoadSuccess(ResWeight.ResType type)
    {
        switch (type)
        {
        case ResWeight.ResType.model:
            ResWeight.loaded_model += 50;
            break;

        case ResWeight.ResType.fx:
            ResWeight.loaded_fx += 10;
            break;

        case ResWeight.ResType.uiprefab:
            ResWeight.loaded_uiprefab += 20;
            break;

        case ResWeight.ResType.uiatlas:
            ResWeight.loaded_uiatlas += 20;
            break;

        case ResWeight.ResType.spine:
            ResWeight.loaded_spine += 20;
            break;

        default:
            Debug.LogError("no contains type, type = " + type);
            break;
        }
    }
Exemplo n.º 3
0
 private void LoadSuccessWithCheck(ResWeight.ResType type)
 {
     Loading.Instance.PreloadFinish(ResWeight.GetWeight(type));
     ResWeight.LoadSuccess(type);
     if (ResWeight.IsLoadFinished(type))
     {
         this.JustLoadNextResource(type);
     }
 }
Exemplo n.º 4
0
 private void JustLoadNextResource(ResWeight.ResType finish_type)
 {
     if (finish_type != ResWeight.ResType.none)
     {
         Debug.Log("=====================>load resource finish, type = " + finish_type);
     }
     if (this.m_preload_resource_actions.get_Count() > 0)
     {
         Action action = this.m_preload_resource_actions.get_Item(0);
         this.m_preload_resource_actions.RemoveAt(0);
         action.Invoke();
     }
 }
Exemplo n.º 5
0
 private void PreloadSpines(ResWeight.ResType type)
 {
     if (ResWeight.IsLoadFinished(type))
     {
         this.JustLoadNextResource(ResWeight.ResType.none);
         return;
     }
     using (HashSet <string> .Enumerator enumerator = LoadingRes.m_load_spines.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             string current = enumerator.get_Current();
             AssetManager.AssetOfSpineManager.LoadAssetWithPool(FileSystem.GetPathOfSpine(current), delegate(bool isSuccess)
             {
                 this.LoadSuccessWithCheck(type);
             });
         }
     }
 }
Exemplo n.º 6
0
 private void PreloadUiAtlas(ResWeight.ResType type)
 {
     if (ResWeight.IsLoadFinished(type))
     {
         this.JustLoadNextResource(ResWeight.ResType.none);
         return;
     }
     using (HashSet <string> .Enumerator enumerator = LoadingRes.m_load_uiatlas.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             string current = enumerator.get_Current();
             AssetManager.AssetOfTPManager.LoadAtlas(current, delegate(bool isSuccess)
             {
                 this.LoadSuccessWithCheck(type);
             });
         }
     }
 }
Exemplo n.º 7
0
    public static int GetWeight(ResWeight.ResType type)
    {
        switch (type)
        {
        case ResWeight.ResType.model:
            return(50);

        case ResWeight.ResType.fx:
            return(10);

        case ResWeight.ResType.uiprefab:
            return(20);

        case ResWeight.ResType.uiatlas:
            return(20);

        case ResWeight.ResType.spine:
            return(20);

        default:
            Debug.LogError("no contains type, type = " + type);
            return(0);
        }
    }
Exemplo n.º 8
0
    public static bool IsLoadFinished(ResWeight.ResType type)
    {
        switch (type)
        {
        case ResWeight.ResType.model:
            return(ResWeight.loaded_model >= ResWeight.total_model);

        case ResWeight.ResType.fx:
            return(ResWeight.loaded_fx >= ResWeight.total_fx);

        case ResWeight.ResType.uiprefab:
            return(ResWeight.loaded_uiprefab >= ResWeight.total_uiprefab);

        case ResWeight.ResType.uiatlas:
            return(ResWeight.loaded_uiatlas >= ResWeight.total_uiatlas);

        case ResWeight.ResType.spine:
            return(ResWeight.loaded_spine >= ResWeight.total_spine);

        default:
            Debug.LogError("no contains type, type = " + type);
            return(false);
        }
    }