lwb
2020-12-01 359acfd36c10c34c5924c6cd1d3ff7249aa0d9d9
SdkProject/app/src/main/java/com/secondworld/demo/MainActivity.java
@@ -4,6 +4,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import com.secondworld.sdk.GTGameApp;
import com.secondworld.sdk.GameActivityProxy;
import com.secondworld.sdk.UnityMsgHandler;
import com.secondworld.sdk.utils.CodeU2A;
@@ -37,7 +38,12 @@
            e.printStackTrace();
            LogUtil.e("GameActivity", e);
        }
        findViewById(R.id.btnInit).setOnClickListener((v ->
        addEvent();
    }
    private void addEvent()
    {
        findViewById(R.id.login).setOnClickListener((v ->
        {
            JSONObject json = new JSONObject();
            try {
@@ -47,8 +53,23 @@
            }
            UnityMsgHandler.onUnityMessage(json.toString());
        }));
    }
        findViewById(R.id.pay).setOnClickListener((v -> {
            JSONObject json = new JSONObject();
            try {
                json.put("code", CodeU2A.PlatformPay);
                json.put("cpInfo", System.currentTimeMillis()/1000+"");
                json.put("orderId", System.currentTimeMillis()/1000+"");
                json.put("sid", "1");
                json.put("roleID","test_role");
                json.put("title","goods_100");
                json.put("mount","0.01");
            } catch (JSONException e) {
                e.printStackTrace();
            }
            UnityMsgHandler.onUnityMessage(json.toString());
        }));
    }
    @Override
    protected void onStart() {
        super.onStart();