void Awake() { if (_singleton != null) { Debug.LogError( string.Format("Created multiple NativePluginLoader objects. Destroying duplicate created on GameObject [{0}]", this.gameObject.name)); Destroy(this); return; } _singleton = this; DontDestroyOnLoad(this.gameObject); _path = Application.dataPath + "/Plugins/"; LoadAll(); }
void OnDestroy() { UnloadAll(); _singleton = null; }