Esempio n. 1
0
        private static void GenerateDefaultResInfo(IResLoader resLoader, ref string abPath, ref string assetName)
        {
            if (string.IsNullOrEmpty(abPath))
            {
                abPath = string.Format("AssetBundle/{0}.assetbundle", resLoader.GetType().Name.ToString().ToLower());
            }

            if (string.IsNullOrEmpty(assetName))
            {
                assetName = resLoader.GetType().Name.ToString();
            }
        }
Esempio n. 2
0
        private static void ParseResInfoAttribute(IResLoader resLoader, ref string abPath, ref string assetName, ref bool async, ref AssetLocation location)
        {
            Type type = resLoader.GetType();

            object[] attributes = type.GetCustomAttributes(typeof(ResInfoAttribute), true);

            if (attributes != null)
            {
                foreach (ResInfoAttribute attr in attributes)
                {
                    if (attr != null)
                    {
                        abPath = attr.abPath;

                        assetName = attr.assetName;

                        async = attr.async;

                        location = attr.location;
                    }
                }
            }
        }