<pre name="code" class="java">package com.tx.sdk.letv; public class UnityLetvSDK { public void InitSDK(String appkey) { System.out.println("InitSDK................................" + appkey); } public void Pay() { System.out.println("Pay................................"); } }
Unity工程里面
static class SinglrtonHolder{
public static AndroidJavaClass instance_sdk;
protected static AndroidJavaObject m_JavaObject = null;
static SingletonHolder()
{
instance_sdk=new AndrowJavaClass("com.3x.sdk.letv.UnityLetvSDK");
}
//初始化,包括登录 public static void LetvSDKInit(string loginSdkAppKey) { SingletonHolder().Call("InitSDK"); } //购买 public static void Pay(Dictionary<string, string> attributes) { SingletonHolder().Call("Pay"); }