28 lines
1.2 KiB
Java
28 lines
1.2 KiB
Java
package world.cryville.input.unity.android;
|
|
|
|
import com.unity3d.player.UnityPlayer;
|
|
import com.unity3d.player.UnityPlayerActivity;
|
|
import world.cryville.input.unity.android.NativeMethods;
|
|
|
|
public abstract class Proxy {
|
|
protected static UnityPlayerActivity activity;
|
|
|
|
static int _count;
|
|
int _id;
|
|
|
|
public Proxy() {
|
|
if (activity == null) activity = (UnityPlayerActivity)UnityPlayer.currentActivity;
|
|
_id = _count++;
|
|
}
|
|
|
|
public int getId() { return _id; }
|
|
|
|
public abstract void activate();
|
|
public abstract void deactivate();
|
|
|
|
protected void feed(int id, int action, long time) { NativeMethods.feed(_id, id, action, time, 0, 0, 0, 0); }
|
|
protected void feed(int id, int action, long time, float x) { NativeMethods.feed(_id, id, action, time, x, 0, 0, 0); }
|
|
protected void feed(int id, int action, long time, float x, float y) { NativeMethods.feed(_id, id, action, time, x, y, 0, 0); }
|
|
protected void feed(int id, int action, long time, float x, float y, float z) { NativeMethods.feed(_id, id, action, time, x, y, z, 0); }
|
|
protected void feed(int id, int action, long time, float x, float y, float z, float w) { NativeMethods.feed(_id, id, action, time, x, y, z, w); }
|
|
} |