This is seriously nerve wracking...
Start a new project: Class Library (Portable) TRhe targets are whatever is selected. Go!
I have a Duality instalation where I reference Duality, DualityPrimitives and Plugins\Tilemaps.core.dll.
In my class lib, I just write this:
Code:
public string CountTiles(Tilemap tilemap)
{
return $"{tilemap.Tiles.Count()}";
}
I slap the built .dll in the plugins folder.
Fire up Dualitor.
In my scene, I add a tilemap with default settings.
Open VS to add code. Rename "YourCustomComponentType" to "Start"
Implement interface Initializable.
Reference my ClassLibrary, tilemaps.core.dll that are in the plugins folder.
On the Init method, I invoke my CountTiles() method, passing the tilemap as an overload.
Code:
Class1 c = new Class1();
c.CountTiles(Scene.Current.FindComponent<Tilemap>();
Press F6, Dualitor refreshes.
In the scene, I add my Start component to the camera, that immediately spits the MissingMethodException.
This just happened in the smallest example I can think of. This HAS to be something with the way I reference the libraries. Upon build, all the DLLs are in the same output folder. Weren't Tilemaps.core.dll and my class be inside a Plugins folder?
_________________
Hello there! Nice to meet you!
I have
github. Apologies in advance for bad coding practices.