Unofficial plugin which enables you to build Unity applications for Android with Myo support.
You need to add both folders to your Unity projects Assets folder. I tested the plugin with Unity 5.1.2 and a Galaxy Note 4. Although I used Myo Android SDK 0.10.0 and Myo software version 1.0.0 to build the project. The "AndroidPlugin" itself is built as an "Android Bound Service" so it is mentioned in the Manifest file but not as the main-application. This should enable you to use a second plugin more easily.
\Assets
+---MyoPlugin
| +---Demo
| | +---Scenes
| | | MyoDemoScene.unity
| | \---Scripts
| | MyoPluginDemo.cs
| +---Prefabs
| | MyoManager.prefab
| \---Scripts
| MyoBinding.cs
| MyoManager.cs
\---Plugins
\---Android
| AndroidManifest.xml
| AndroidPlugin.jar
\---libs
\---armeabi-v7a
libgesture-classifier.so
When you build your own scene, you simply need to have a GameObject thats called "MyoManager" with the MyoManger script attached to it. For an out of the box solution, there is also a prefab included which you can drag into your scene. You now can start the plugin via "MyoManager.Initialize", the other methods are called in the same manner. The code below represents the methods which can be called using the MyoManger.
/// Manager class for Myo Android Plugin. Use only this public API to interface with Myo inside of Unity.
public class MyoManager : MonoBehaviour
{
/// Subscribe to this event to recieve Pose event notifications
public static event Action<MyoPose> PoseEvent;
/// More standard Myo events you can subscribe to
public static event Action AttachEvent, DetachEvent, ConnectEvent, DisconnectEvent,
ArmSyncEvent, ArmUnsyncEvent, LockEvent, UnlockEvent;
/// Initializes and enables Myo plugin
public static void Initialize();
/// Uninitialize and disables Myo plugin
public static void Uninitialize();
/// Automatically pairs with the first Myo device that touches the iOS device.
public static void AttachToAdjacent();
/// Gets the rotation of the Myo device, converted into Unity's coordinate system (See MyoToUnity).
public static Quaternion GetQuaternion()
/// Vibrates the Myo device for the specified length, Short, Medium, or Long.
public static void VibrateForLength( MyoVibrateLength length );
/// Tells you if the plugin is already initialized
public static bool GetIsInitialized(){
/// Tells you if a Myo is already attached to the device
public static bool GetIsAttached()
}
This project was kind of rushed, so if you have any feedback just contact me (Florian.Strieg@Student.Reutlingen-University.DE). Although i cannot guarantee any direct support I'm looking forward to develop this plugin a bit further.
Last but not least I would like you to know that I took inspiration and parts of code from https://github.com/zoiclabs/Myo-Unity-iOS-Plugin. I liked the architecture so hopefully the creator will be okay with it =)