rb.velocity = new Vector2(movement.x * Speed, rb.velocity.y);
rb.AddForce(Vector2.up * JumpForce / (JumpTime * 10));
javaClass = new AndroidJavaClass("ua.leomovskii.abub");
javaClass.CallStatic("Initialize");
javaObject = javaClass.GetStatic<AndroidJavaObject>("plugin");
public class BluetoothPlugin extends Activity {
public static BluetoothPlugin plugin;
public static Activity currentActivity;
public static BluetoothAdapter adapter;
// other fields
public static void Initialize() {
if (adapter == null)
adapter = BluetoothAdapter.getDefaultAdapter();
if (plugin == null && adapter != null) {
plugin = new BluetoothPlugin();
currentActivity = UnityPlayer.currentActivity;
plugin.ListenStateAdapter();
}
}
// other methods
}