tbb.blayms.mea 1.2.3

dotnet add package tbb.blayms.mea --version 1.2.3
NuGet\Install-Package tbb.blayms.mea -Version 1.2.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="tbb.blayms.mea" Version="1.2.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add tbb.blayms.mea --version 1.2.3
#r "nuget: tbb.blayms.mea, 1.2.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install tbb.blayms.mea as a Cake Addin
#addin nuget:?package=tbb.blayms.mea&version=1.2.3

// Install tbb.blayms.mea as a Cake Tool
#tool nuget:?package=tbb.blayms.mea&version=1.2.3

ModExtraAssets

A tool made specificly to make a proccess of loading custom assets way easier Highly recommended to be used for Unity Engine BepInEx plugins

  • Requires *.zip files (they act as a main file storage)

Documentation

This tool has a documentation outside GitHub, check it here

Supported file types

ModExtraAssets can recognize some file extension to create a specific asset of type

Extension Condition Return type
*.png None UnityEngine.Texture2D
*.png File name must contain !number at the end to define Sprite.pixelsPerUnit Value UnityEngine.Sprite
*.png File name must contain !c at the end to differentiate it from other *.png files UnityEngine.Cubemap
*.wav None UnityEngine.AudioClip
*.obj None UnityEngine.Mesh
*.json Referencing DLLs Any deserializable
*.txt or *.text None System.String
*.dll *.zip configuration System.Reflection.Assembly

Couple of code snippets

Example: Loading database with using Newtonsoft.Json library

Blayms.MEA.ModExtraAssets.LoadAllZipAssets(@"D:\mycoolpluginfolder\myCoolZip.zip", this,
(string json, Type type, object[] extraData) =>
{
return  JsonConvert.DeserializeObject(json, type, (JsonSerializerSettings)extraData[0]);
}, new  object[]{MyCoolClass.GetJsonSerializerSettingsFor<LocalizationData>()});

Example: Do stuff after all asset are finished to load from *.zip

// CREATE THE PROCEDURE
MEAZipLoadingProcedure meazipLoadingProcedure = ModExtraAssets.CreateLoadingProcedure
(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"zip.zip"), BasePlugin.Instance, (string json, Type type, object[] extraData) 
=> JsonConvert.DeserializeObject(json, type, Class.MyJsonSerializerSettings(type)), null);

meazipLoadingProcedure.onLoadingResultDefined += 
delegate (MEAZipLoadingProcedure.LoadingResult loadingResult) // SUB TO EVENT
{
   if(loadingResult == MEAZipLoadingProcedure.LoadingResult.Success)
   {
        //CODE
   }
};
meazipLoadingProcedure.Initiate(); // START LOADING ASSETS

Credits

This tool was made by Blayms and uses some utils found online, such as:

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.3 110 3/28/2024
1.2.1 74 3/26/2024
1.2.0 87 3/25/2024
1.1.1 80 3/20/2024
1.0.5 88 3/20/2024

1.2.3:
- Referenced *.dll files are now accessable. <https://sites.google.com/view/mea-docs/main/useful-information/zip-configuration>
PLANS: Re-look on the method how ModExtraAssets handles AudioClips in a future

1.2.1:
- You can use byte[] to load create MEAZipLoadingProcedure
- JSON now loads in alphabetical order
- Fixed some docs links
- Created a github repo

1.2:
- If MEAZipLoadingProcedure detects a *.json file, it queues the .json creation to be loaded after any other assets finished to load
(Made just because JSON files might contain MEA assets (e.g using custom JsonConverters from JSON.NET))
- ModExtraAsset is not capable of loading Cubemaps (check <https://sites.google.com/view/mea-docs/main/useful-information/supported-types-and-formats> for more info)
- Added new loading status "JsonDeserialization" that sets once all json are getting finished up