Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PluginWrapper : MonoBehaviour {
- public void listen () {
- var plugin = new AndroidJavaClass ("com.example.unitymodule.PluginClass");
- plugin.CallStatic<bool> ("onCheckedListen", true);
- Response ();
- }
- void Response(){
- var plugin = new AndroidJavaClass ("com.example.unitymodule.PluginClass");
- var result = plugin.CallStatic<string> ("returnRes");
- if (result == "jump") {
- transform.Translate (0f, 1.0f, 0f);
- } else if (result == "move left") {
- transform.Translate (-2.0f, 0f, 0f);
- } else if (result == "move right") {
- transform.Translate (2.0f, 0f, 0f);
- } else {
- transform.Translate (2.0f, 0f, 2.0f);
- }
- }
- }
Add Comment
Please, Sign In to add comment