godot-ultraleap-binder/ultraleap-binder/src/main/java/re/lunai/ultraleap_binder/UltraleapBinderGodot.java
2023-11-05 14:12:49 +00:00

57 lines
1.2 KiB
Java

package re.lunai.ultraleap_binder;
import android.util.Log;
//import androidx.annotation.NonNull;
import org.godotengine.godot.Godot;
import org.godotengine.godot.plugin.GodotPlugin;
import org.godotengine.godot.plugin.UsedByGodot;
import com.ultraleap.tracking.service_binder.ServiceBinder;
public class UltraleapBinderGodot extends GodotPlugin implements ServiceBinder.Callbacks {
private ServiceBinder binder;
public UltraleapBinderGodot(Godot godot) {
super(godot);
this.binder = new ServiceBinder(getActivity().getBaseContext(), false);
}
//@NonNull
@Override
public String getPluginName() {
return "UltraleapBinder";
}
@Override
public void onBound() {
Log.i("UltraleapBinder", "onBound called");
}
@Override
public void onUnbound() {
Log.i("UltraleapBinder", "onUnbound called");
}
@UsedByGodot
public void Bind() {
this.binder.bind();
}
@UsedByGodot
public void Unbind() {
this.binder.unbind();
}
@UsedByGodot
public int GetClientCount() {
return this.binder.getClientCount();
}
@UsedByGodot
public boolean IsBound() {
return this.binder.isBound();
}
}