资源简介
Unity微信支付,Unity工程项目,仅供学习如需要java端请留言
代码片段和文件信息
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using System.Text;
using UnityEngine.UI;
public class Test : MonoBehaviour {
AndroidJavaobject javaActive;
public Text text;
public InputField inputf;
// Use this for initialization
[System.Serializable]
public class ModelTest
{
public string prepayid;
public string noncestr;
public string timestamp;
public string sign;
}
private void Start()
{
AndroidJavaClass javaClass = new AndroidJavaClass(“com.unity3d.player.UnityPlayer“);
javaActive = javaClass.GetStaticject>(“currentActivity“);
Debug.Log(javaActive);
}
public void Button1() {
object[] objs = new object[] { inputf.text “商品描述“ “https://www.baidu.com“ “Main Camera“ “回调函数“ };
javaActive.Call(“LocationPayReq“ objs);
//object[] objs = new object[] { “aaaaa“ };
// print(javaActive.Call(“aaa“ objs));
}
public void Button2()
{
StartCoroutine(test());
}
IEnumerator test()
{
UnityWebRequest www = UnityWebRequest.Get(“http://accounts.zyqpyx.com/api/login/pay“);
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.LogError(www.error);
}
else
{
//Debug.Log(www.downloadHandler.text);
ModelTest obj = JsonUtility.FromJson(www.downloadHandler.text);
Debug.Log(“ss“+obj.sign);
object[] objs = new object[] { obj.prepayid obj.noncestr obj.timestampobj.sign “Main Camera“ “回调函数“ };
javaActive.Call(“WeiChatPayReq“ objs);
}
}
public void 回调函数(string s)
{
print(s);
if (s==“0“)
{
print(“支付成功“);
text.text = “支付成功“;
}
else if(s == “-2“)
{
print(“支付取消“);
text.text = “支付取消“;
}
else
{
print(“支付失败“);
text.text = “支付失败“;
}
}
// Update is called once per frame
void Update () {
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-05 16:18 unitywxpay\
目录 0 2018-01-05 16:18 unitywxpay\Assets\
文件 35722 2018-01-05 16:17 unitywxpay\Assets\1.unity
文件 196 2018-01-04 18:01 unitywxpay\Assets\1.unity.me
目录 0 2018-01-05 16:18 unitywxpay\Assets\Plugins\
文件 213 2018-01-04 17:41 unitywxpay\Assets\Plugins.me
目录 0 2018-01-05 16:18 unitywxpay\Assets\Plugins\Android\
文件 213 2018-01-04 17:41 unitywxpay\Assets\Plugins\Android.me
文件 893 2018-01-05 10:37 unitywxpay\Assets\Plugins\Android\AndroidManifest.xm
文件 199 2018-01-04 17:41 unitywxpay\Assets\Plugins\Android\AndroidManifest.xm
文件 56552 2018-01-05 15:19 unitywxpay\Assets\Plugins\Android\app-debug.aar
文件 573 2018-01-05 13:01 unitywxpay\Assets\Plugins\Android\app-debug.aar.me
文件 2399 2018-01-05 16:12 unitywxpay\Assets\Test.cs
文件 284 2018-01-04 17:57 unitywxpay\Assets\Test.cs.me
目录 0 2018-01-05 16:18 unitywxpay\ProjectSettings\
文件 357 2018-01-04 17:39 unitywxpay\ProjectSettings\AudioManager.asset
文件 114 2018-01-04 17:39 unitywxpay\ProjectSettings\ClusterInputManager.asset
文件 763 2018-01-04 17:39 unitywxpay\ProjectSettings\DynamicsManager.asset
文件 138 2018-01-04 17:39 unitywxpay\ProjectSettings\EditorBuildSettings.asset
文件 589 2018-01-04 17:39 unitywxpay\ProjectSettings\EditorSettings.asset
文件 2290 2018-01-04 17:44 unitywxpay\ProjectSettings\GraphicsSettings.asset
文件 5793 2018-01-04 17:39 unitywxpay\ProjectSettings\InputManager.asset
文件 1308 2018-01-04 17:39 unitywxpay\ProjectSettings\NavMeshAreas.asset
文件 151 2018-01-04 17:39 unitywxpay\ProjectSettings\NetworkManager.asset
文件 1400 2018-01-04 17:39 unitywxpay\ProjectSettings\Physics2DSettings.asset
文件 17898 2018-01-05 16:17 unitywxpay\ProjectSettings\ProjectSettings.asset
文件 28 2018-01-04 17:39 unitywxpay\ProjectSettings\ProjectVersion.txt
文件 4864 2018-01-04 17:39 unitywxpay\ProjectSettings\QualitySettings.asset
文件 378 2018-01-04 17:39 unitywxpay\ProjectSettings\TagManager.asset
文件 202 2018-01-04 17:39 unitywxpay\ProjectSettings\TimeManager.asset
文件 812 2018-01-04 17:39 unitywxpay\ProjectSettings\UnityConnectSettings.asset
............此处省略2个文件信息
相关资源
- unity3D 蓝牙插件 iOS & Android
- Unity3D AR生存射击游戏 完整源码 AR S
- unity android obb
- Highlighting System V5.0
- Unity打开IOS/Android图库和相机获取相片
- Bluetooth LE for iOS and Android v2.3.unitypac
- Unity插件Bluetooth LE For iOS and Android
- unity解决android9.0 http请求会被拦截.z
- Unity内嵌网页插件-unity-webview
- UnityDownloadAssistant-5.6.6f2
- Unity调用Android/IOS系统相册、摄像机,
- EasyMovieTexture 3.77-1.unitypackage
- Unity 手机震动插件Vibration
- Androidstudio和unity 交互 调用相机相册
- unity remote
- unity通过usb连接艾茉森IQ-100电钢琴并接
- NatCorder - 1.7.1.zip
- AssetStudio
- Bluetooth LE for iOS tvOS and Android
- libsqlite3.so.rar
- NatCorder - Video Recording_1.7.1
- NatCorder - Video Recording API_1.7.1.unitypac
- Unity Android接入微信SDK登陆,分享,支
- unity 卡片椭圆方向滚动
- Unity3D 超级宝库]Unity滑动切换效果插件
- libsqlite3.so.0 dll
- 物体旋转和缩放
- Unity调用Android安装APK以及重启,7.0及
- Unity与Android交互实现更新App
评论
共有 条评论