Exemplo n.º 1
0
    public static BundleCreateAsyncTask LoadFileAtStreamingAssetsPath(string fileName, bool usePlatform, int priority = 0)
    {
        fileName = WWWFileLoadTask.GetStreamingAssetsPath(usePlatform, true) + "/" + fileName;
        BundleCreateAsyncTask ret = Create(fileName, priority);

        return(ret);
    }
Exemplo n.º 2
0
 private static void PoolReset(BundleCreateAsyncTask task)
 {
     if (task == null)
     {
         return;
     }
     task.ItemPoolReset();
 }
Exemplo n.º 3
0
 private static void InPool(BundleCreateAsyncTask task)
 {
     if (!m_UsePool || task == null || task.m_IsInPool)
     {
         return;
     }
     InitPool();
     m_Pool.Store(task);
     task.m_IsInPool = true;
 }
Exemplo n.º 4
0
    public static BundleCreateAsyncTask Create(string createFileName)
    {
        if (string.IsNullOrEmpty(createFileName))
        {
            return(null);
        }
        BundleCreateAsyncTask ret = GetNewTask();

        ret.m_FileName = createFileName;
        return(ret);
    }
Exemplo n.º 5
0
    private static BundleCreateAsyncTask GetNewTask()
    {
        if (m_UsePool)
        {
            InitPool();
            BundleCreateAsyncTask ret = m_Pool.GetObject();
            if (ret != null)
            {
                ret.m_IsInPool = false;
            }
            return(ret);
        }

        return(new BundleCreateAsyncTask());
    }
Exemplo n.º 6
0
    void RefMapUpdate()
    {
        if (!Application.isPlaying)
        {
            return;
        }

        float curTime = Time.unscaledTime;

        m_IsUPdateData = curTime - m_LastUpdateTime > 0.25f;

        if (m_IsUPdateData)
        {
            m_LastUpdateTime = curTime;
        }

        if (m_IsUPdateData)
        {
            bool isChg = UpdateAssetRefMap();

            int cnt = TimerMgr.Instance.TimerPoolCount;
            if (cnt != m_LastTimeCnt)
            {
                m_LastTimeCnt = cnt;
                isChg         = true;
            }

            cnt = ResourceAssetCache.GetPoolCount();
            if (cnt != m_LastResCacheCnt)
            {
                m_LastResCacheCnt = cnt;
                isChg             = true;
            }

            cnt = AssetBundleCache.GetPoolCount();
            if (cnt != m_LastBundleCacheCnt)
            {
                m_LastBundleCacheCnt = cnt;
                isChg = true;
            }

#if UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_2018 || UNITY_2019
            cnt = BundleCreateAsyncTask.GetPoolCount();
            if (cnt != m_LastBundleCreateCnt)
            {
                m_LastBundleCreateCnt = cnt;
                isChg = true;
            }
                        #endif

            cnt = WWWFileLoadTask.GetPoolCount();
            if (cnt != m_LastWWWCreateCnt)
            {
                m_LastWWWCreateCnt = cnt;
                isChg = true;
            }

            cnt = HttpHelper.RunCount;
            if (cnt != m_LastRunHttpCnt)
            {
                m_LastRunHttpCnt = cnt;
                isChg            = true;
            }

            cnt = HttpHelper.PoolCount;
            if (cnt != m_LastHttpPoolCnt)
            {
                m_LastHttpPoolCnt = cnt;
                isChg             = true;
            }

            if (isChg)
            {
                this.Repaint();
            }
        }
    }