Esempio n. 1
0
    void OnDestroy()
    {
        AssetsMgr.GetInst().Uninit();

        CoroutineTaskMgr.GetInst().Uninit();
        LoopUpdateMgr.GetInst().Uninit();
        LogUtils.Log("main ondestory!");
        LogUtils.Uninit();
    }
    // Start is called before the first frame update
    void Start()
    {
//        var obj = assetsMgr.LoadAsset<GameObject>(AssetsAssetBundlePrefabsGame_2d.BundleName,AssetsAssetBundlePrefabsGame_2d.PREFAB_WORLD);
        var obj = assetsMgr.LoadAsset <GameObject>(AssetsAssetBundlePrefabsGame_2d.BundleName, "Egg");

        if (obj == null)
        {
            Debug.LogError($"prefab is not exist ");
            return;
        }
        AssetsMgr.CreateGameObject(obj, null);
    }
    private void Awake()
    {
//        Gloabal.ConfigLoader.Instance.Load ();
//        Gloabal.ConfigLoader1.Instance.Load ();
//        Gloabal.ConfigLoader2.Instance.Load ();
//        ResKit.Init();
        assetsMgr = new AssetsMgr();
        if (!File.Exists(Path.Combine(Application.persistentDataPath, AssetBundlePathConst.RuntimeAssetsRoot, "Version.txt")))
        {
            Debug.LogError("CopyToPersistentDataPath");
            CopyToPersistentDataPath();
        }
    }
Esempio n. 4
0
        private void OnReceiveMemoryWarning(string msg)
        {
            float currTime = Time.realtimeSinceStartup;

            if (currTime - m_TimeOfLastGC > gcInterval)
            {
                LogMgr.W("内存警告, 强制回收内存");
                AssetsMgr.GC();
                m_TimeOfLastGC = currTime;
            }
            else
            {
                LogMgr.W("过于频繁了,等会再回收");
            }
        }
Esempio n. 5
0
 private static int GC(ILuaState lua)
 {
     AssetsMgr.GC();
     return(0);
 }