Search Unity

Unity Android plugins collision solution

Discussion in 'Android' started by Martin_Gonzalez, May 23, 2018.

  1. Martin_Gonzalez

    Martin_Gonzalez

    Joined:
    Mar 25, 2012
    Posts:
    361
    When you want to create a Unity plugin for Unity Android, and you need to listen Activity methods Unity encourage us to extend UntiyPlayerActivity in their documentation.

    Unity Doc: https://docs.unity3d.com/Manual/AndroidUnityPlayerActivity.html

    This is fine just for one plugin. If we want to integrate another plugin that also extends from UntiyPlayerActivity we will need to merge code and that's messy.

    I've been working in a solution for this and it would be great that Unity implement it.

    Solution: https://github.com/MartinGonzalez/UnityPlayerActivityListener

    Benefits:
    • No need to merge things on AndroidManifest.xml.
    • No more code merging when wanting to integrate a plugin.
    • This will be vital with Unity Package Manager.
    • Create N number of plugins listening Activity lifecycle events.
    • Faster development.
    If you found this useful please vote this: https://feedback.unity3d.com/suggestions/provide-unityplayeractivity-events-for-unity-android