static void SetupAssetVariantMapsAsset() { const string assetVariantMapsPath = "Assets/AssetVariantMaps.asset"; if (File.Exists(assetVariantMapsPath)) { AssetDatabase.DeleteAsset(assetVariantMapsPath); } var assetVariantMappingObj = ScriptableObject.CreateInstance <AssetVariantMappingObject>(); assetVariantMappingObj.assetVariantMaps = AssetVariantMapping.GetAssetVariantMaps();; AssetDatabase.CreateAsset(assetVariantMappingObj, assetVariantMapsPath); AssetImporter importer = AssetImporter.GetAtPath(assetVariantMapsPath); importer.assetBundleName = "AssetVariantMapsBundle"; }
static void InitAssetVariants() { var obj = ResourceManager.instance.Load <AssetVariantMappingObject>("assets/assetvariantmaps.asset"); AssetVariantMapping.SetAssetVariantMaps(obj.assetVariantMaps); }