Hello!
I have the following task:
I’m writing a plugin that, when enabled, should automatically enable another plugin (in order not to duplicate someone else’s logic, I want my plugin to work together and expand functionality)
I want to programmatically check whether another plugin is loaded and if so, then call its functions (the simplest thing I want is to manage enable/disable), if not, then write an error in the log: “plugin XXX not found, please connect it to the scene..
It was not possible to find any working example, please tell me how this can be implemented.
This is some sample pseudocode.
Thank you in advance!
I have the following task:
I’m writing a plugin that, when enabled, should automatically enable another plugin (in order not to duplicate someone else’s logic, I want my plugin to work together and expand functionality)
I want to programmatically check whether another plugin is loaded and if so, then call its functions (the simplest thing I want is to manage enable/disable), if not, then write an error in the log: “plugin XXX not found, please connect it to the scene..
It was not possible to find any working example, please tell me how this can be implemented.
This is some sample pseudocode.
Java:
public void onMyPluginEnalbed(boolean isEnabled) {
Plugin plugin = findResource("RegEXp_or_pluginAutor.pluginName.xxx");
if (plugin == null) {
System.err.println("Plugin pluginAutor.pluginName not found, please init first");
} else {
plugin.enabled = isEnabled;
}
}
Thank you in advance!