This repository is trying to answer the question. How do I get custom MonoBehaviour
s out of Unity and into Valheim?
💲 Closed-source license is available for commercial or personal use.
- Upload permission: You are not allowed to upload any files in this repository to other sites under any circumstances.
- Asset use permission: You are not allowed to use any of the assets; Unity assets, image files, and icon file, in this repository under any circumstances.
- Is your code private, closed-source, or proprietary?
- Do you charge money to use your code?
- Is your code not compatable with GNU Affero General Public License v3.0?
❗ If you answered YES to any of the above, you must acquire a Closed-source license. ❗
📃 If you answered NO to all the above questions. You may:
- Direct your users to download the DLL from the GitHub Releases page.
- Direct your users to download the DLL from the nexusmods.com page.
-
1st Exemption: You may IL Weave the DLL into your own DLL, if, and only if, you meet the requirements for the Open Source License and you include, in your ReadMe file and Main page for downloading your code, one of the following statements in clear readable font at 12pt or higher. Take a look at ILMerge.Fody for your IL Weaving needs.
-
2nd Exemption: You may include the DLL as part of a collection of DLLs aka Mod Packs, if, and only if, you meet the requirements for the Open Source License and you include, in your ReadMe file and Main page for downloading your collection, one of the following statements in clear readable font at 12pt or higher.
HTML
Uses <a href="https://tinyurl.com/drcmbs">Digitalroot's Custom MonoBehaviours</a>
Markdown
Uses [Digitalroot's Custom MonoBehaviours](https://tinyurl.com/drcmbs)
Text
Uses Digitalroot's Custom MonoBehaviours - https://tinyurl.com/drcmbs
Tell the RepositoryLoader
to load your DLL. I put this in Awake
RepositoryLoader.LoadAssembly("Digitalroot.CMB.Repository.dll");
Later when loading your asset, attach your CMB to the GameObject
Debug.Log("Loading Wizard");
var wizardAssetBundle = Jotunn.Utils.AssetUtils.LoadAssetBundleFromResources("wizard", Assembly.GetExecutingAssembly());
var wizard = wizardAssetBundle.LoadAsset<GameObject>("Wizard");
wizard.AddMonoBehaviour("CMB_SpinClockwise"); // Loaded from Digitalroot.CMB.Repository.dll
Jotunn.Managers.PrefabManager.Instance.AddPrefab(wizard);
wizardAssetBundle.Unload(false);
Check out the Wiki
There are a few choices for installation:
- Install the NuGet package via dotnet cli.
dotnet add PROJECT package Digitalroot.CustomMonoBehaviours
- Install the NuGet package via Package Manager.
PM>
Install-Package Digitalroot.CustomMonoBehaviours
- For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageReference Include="Digitalroot.CustomMonoBehaviours" Version="1.0.*" />
- Download the NuGet Package from GitHub.
- Download the DLL from the GitHub Releases page.
- Digitalroot
- sbtoonz
- The ๖̶̶̶ζ͜͡Odin Plus Team) Discord community.
- The Valheim Discord community.