Hi all,
I created a simple script containing a method with [RuntimeInitializeOnLoadMethod]
and then packed this script into a dll.
After that I created an empty project, imported this dll and built it for Android and iOS. On Android everything worked fine (the method is called as expected), but on iOS the method doesn’t seem to be called at all.
So the question is: Did I do something wrong or DLLs don’t work on iOS?
I used Unity 2018.2.11f1 to pack the dll and for the empty project.
This is the script I packed into a dll:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestInitializeOnLoad : MonoBehaviour {
[RuntimeInitializeOnLoadMethod]
static void OnRuntimeMethodLoaded()
{
Debug.Log("I'm initializing in runtime");
}
}