loadGameMode method

Future<SetonixPlugin?> loadGameMode(
  1. AssetManager assetManager,
  2. ItemLocation? location
)

Implementation

Future<SetonixPlugin?> loadGameMode(
  AssetManager assetManager,
  ItemLocation? location,
) async {
  if (location == null) return null;
  final gameMode = assetManager
      .getPack(location.namespace)
      ?.getMode(location.id);
  if (gameMode == null) return null;
  final script = gameMode.script;
  if (script == null || script.isEmpty) return null;
  final scriptLocation = ItemLocation.fromString(script, location.namespace);
  return loadLuaPluginFromLocation(assetManager, scriptLocation);
}