Can I cut plugin functionality?

Some developers wish to keep their project as clean as possible and do not want to keep unused assets or code in the project.

And that is a common question how to remove some of the plugin parts. I am developing plugins as one complete project, so I cannot give straight forward instructions how to delete some features. Besides, I would not recommend doing that. Cutting few scripts from the project will save you couple of bytes, but you will lose useful feature which you will probably want to use in the future and you also may harm the whole plugin by doing this.

 

But actually there is a reason to cut Facebook part if you are not using this. Because it uses Unity Official Facebook Plugins which will add around 5MB to your final build.

In the latest version you can do this quite simply.

Simply go to plugins settings and press the remove Facebook SDK button.

skitch.png

 

Or you can simply remove the following folders and files:

  • Assets/Facebook
  • Plugins/Android/facebook
  • Assets/Extensions/GooglePlayCommon/Social/Facebook
  • Assets/Extensions/AndroidNative/xExample/Scripts/Social/FacebookAndroidUseExample.cs

 

Starting from version 4.9 you can also choose plugin API which will be included in the build using the plugin editor settings:

 

Starting from v 5.0 you can manage all plugin APIs:

You can get event information about API managment in the Manifest Requirements article.

 

If you still want  to cut other features, you can do this at your own risk. Full plugins source will be opened including eclipse project.You can learn how to compile Android Native libraries with this article.