Esempio n. 1
0
        public void LoadAssetAsync <T>(string assetName, Action <string, T> callback = null) where T : Object
        {
            XDebug.Log(XABConst.Tag, $"--加载AssetObject(异步) {assetName}");
            assetName = assetName.ToLower();
            var assetPath = XABAssetNameConfig.GetAssetPath(assetName);

            callback?.Invoke(assetName, AssetDatabase.LoadAssetAtPath <T>(assetPath));
        }
Esempio n. 2
0
        public T LoadAsset <T>(string assetName) where T : Object
        {
            XDebug.Log(XABConst.Tag, $"--加载AssetObject(同步) {assetName}");
            assetName = assetName.ToLower();
            var assetPath = XABAssetNameConfig.GetAssetPath(assetName);

            return(AssetDatabase.LoadAssetAtPath <T>(assetPath));
        }