Example #1
0
        //提供池子里的给过去
        public override LoadAssetBase Spawn()
        {
            if (m_Vector == null)
            {
                GameObject obj = new GameObject(s_VectorName);
                m_Vector = obj.AddComponent <LoadAssetVector>();
            }
            LoadAssetBase t = null;

            if (_freeObjs.Count <= 0)
            {
                //本套资源流式装卸用LoadAsset,如果自己写的请继承LoadAssetBase类,然后new你的这个类
                t = new LoadAsset(m_Vector);
                //t = new LoadAssetBase(m_Vector);
                _busyObjs.Add(t);
                t.OnEnable();
                return(t);
            }

            t = _freeObjs[0];
            _freeObjs.RemoveAt(0);
            _busyObjs.Add(t);
            t.OnEnable();
            return(t);
        }
Example #2
0
 public LoadAssetBase(LoadAssetVector vector)
 {
     m_Vector = vector;
 }
Example #3
0
 public LoadAsset(LoadAssetVector vector) : base(vector)
 {
 }