using UnityEngine; using System.Collections; using System.Collections.Generic; public class AliplayManager : UnitySingleton { private AndroidJavaObject androidUnityTool; public void Init() { androidUnityTool = new AndroidJavaObject("com.dashgame.unity.UnityTool"); androidUnityTool.Call("setResponseGameObject", this.name); } public void Pay(){ AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject currentActivity = jc.GetStatic("currentActivity"); //Pay(string orderInfo, Activity activity) androidUnityTool.Call("pay", "a=3", currentActivity); // 传递的参数需与服务器协商 } public void OnPayResult(string result) { //if result=9000 means pay success; } }