@@ -8,6 +8,10 @@ required for displaying ads. | |||||
package="com.google.unity.ads" | package="com.google.unity.ads" | ||||
android:versionName="1.0" | android:versionName="1.0" | ||||
android:versionCode="1"> | android:versionCode="1"> | ||||
<uses-permission android:name="android.permission.INTERNET"/> | |||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | |||||
<uses-sdk android:minSdkVersion="14" | <uses-sdk android:minSdkVersion="14" | ||||
android:targetSdkVersion="19" /> | android:targetSdkVersion="19" /> | ||||
<application> | <application> | ||||
@@ -0,0 +1,87 @@ | |||||
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN | |||||
buildscript { | |||||
repositories { | |||||
mavenCentral() | |||||
google() | |||||
jcenter() | |||||
} | |||||
dependencies { | |||||
classpath 'com.android.tools.build:gradle:3.4.0' | |||||
**BUILD_SCRIPT_DEPS**} | |||||
} | |||||
allprojects { | |||||
repositories { | |||||
mavenCentral() | |||||
google() | |||||
jcenter() | |||||
flatDir { | |||||
dirs 'libs' | |||||
} | |||||
} | |||||
} | |||||
apply plugin: 'com.android.application' | |||||
**APPLY_PLUGINS** | |||||
dependencies { | |||||
implementation fileTree(dir: 'libs', include: ['*.jar']) | |||||
implementation 'com.tencent.mm.opensdk:wechat-sdk-android:+' | |||||
**DEPS**} | |||||
android { | |||||
compileSdkVersion **APIVERSION** | |||||
buildToolsVersion '**BUILDTOOLS**' | |||||
compileOptions { | |||||
sourceCompatibility JavaVersion.VERSION_1_8 | |||||
targetCompatibility JavaVersion.VERSION_1_8 | |||||
} | |||||
defaultConfig { | |||||
minSdkVersion **MINSDKVERSION** | |||||
targetSdkVersion **TARGETSDKVERSION** | |||||
applicationId '**APPLICATIONID**' | |||||
ndk { | |||||
abiFilters **ABIFILTERS** | |||||
} | |||||
versionCode **VERSIONCODE** | |||||
versionName '**VERSIONNAME**' | |||||
} | |||||
lintOptions { | |||||
abortOnError false | |||||
} | |||||
aaptOptions { | |||||
noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**] | |||||
}**SIGN** | |||||
buildTypes { | |||||
debug { | |||||
minifyEnabled **MINIFY_DEBUG** | |||||
useProguard **PROGUARD_DEBUG** | |||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD** | |||||
jniDebuggable true | |||||
} | |||||
release { | |||||
minifyEnabled **MINIFY_RELEASE** | |||||
useProguard **PROGUARD_RELEASE** | |||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG** | |||||
} | |||||
}**PACKAGING_OPTIONS****SPLITS** | |||||
**BUILT_APK_LOCATION** | |||||
bundle { | |||||
language { | |||||
enableSplit = false | |||||
} | |||||
density { | |||||
enableSplit = false | |||||
} | |||||
abi { | |||||
enableSplit = true | |||||
} | |||||
} | |||||
}**SPLITS_VERSION_CODE****REPOSITORIES****SOURCE_BUILD_SETUP** |
@@ -1,6 +1,5 @@ | |||||
fileFormatVersion: 2 | fileFormatVersion: 2 | ||||
guid: d6ad8286d7e80294eb80aa5aaed5056b | |||||
folderAsset: yes | |||||
guid: 405d0c3f1d6395f4590319bfa7c21842 | |||||
DefaultImporter: | DefaultImporter: | ||||
externalObjects: {} | externalObjects: {} | ||||
userData: | userData: |
@@ -1,8 +0,0 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 2384b8e0290245840819d01f63bece91 | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -1,8 +0,0 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 19524eda8e7faf84cb7eaa25ab7f11fa | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -12,7 +12,9 @@ public class HttpManager : MonoBehaviour | |||||
static public int isZhengShi = 3; | static public int isZhengShi = 3; | ||||
string urlHead = GetUrlHead(isZhengShi); | string urlHead = GetUrlHead(isZhengShi); | ||||
[HideInInspector] | |||||
public string phoneNum = "13212713350"; | public string phoneNum = "13212713350"; | ||||
[HideInInspector] | |||||
public string LastOrderNo; | public string LastOrderNo; | ||||
public CIG3StoreProduct LastProduct; | public CIG3StoreProduct LastProduct; | ||||
@@ -1,8 +0,0 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 4ec2e37c4370f08449bf5b4d40841060 | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -1,8 +0,0 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 7e022f18d563f2346a1d1db08db4eca4 | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -1,8 +0,0 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 0c5acbc1dec75df4c84be2acecb890db | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -1,8 +0,0 @@ | |||||
fileFormatVersion: 2 | |||||
guid: a898de8a91b9aab4682567251441e068 | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -0,0 +1,48 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
public class WeChatLogin : MonoBehaviour | |||||
{ | |||||
// 单例模式 | |||||
public static WeChatLogin Instance { get; private set; } | |||||
private void Awake() | |||||
{ | |||||
// 实现单例模式 | |||||
if (Instance != null && Instance != this) | |||||
{ | |||||
Destroy(gameObject); | |||||
} | |||||
else | |||||
{ | |||||
Instance = this; | |||||
DontDestroyOnLoad(gameObject); | |||||
} | |||||
} | |||||
// 发起微信登录 | |||||
public void Login() | |||||
{ | |||||
#if UNITY_ANDROID && !UNITY_EDITOR | |||||
using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) | |||||
{ | |||||
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); | |||||
// 调用你在 Android 插件中实现的微信登录方法 | |||||
using (AndroidJavaClass wxApiClass = new AndroidJavaClass("com.yourcompany.wxapi.WXEntryActivity")) | |||||
{ | |||||
// 这里可以调用一个静态方法,例如 LoginWeChat() | |||||
wxApiClass.CallStatic("LoginWeChat", "your_state_value"); | |||||
} | |||||
} | |||||
#endif | |||||
} | |||||
// 该方法会被 Android 端通过 UnitySendMessage 调用,传回登录结果(JSON格式字符串) | |||||
public void OnWeChatLoginResult(string result) | |||||
{ | |||||
Debug.Log("微信登录返回:" + result); | |||||
// 在此解析 result,得到 unionid、openid 等信息 | |||||
} | |||||
} |
@@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: ae686ed626ce4f844bd3b8a007577ae7 | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@@ -0,0 +1,45 @@ | |||||
%YAML 1.1 | |||||
%TAG !u! tag:unity3d.com,2011: | |||||
--- !u!1 &3375001057570166699 | |||||
GameObject: | |||||
m_ObjectHideFlags: 0 | |||||
m_CorrespondingSourceObject: {fileID: 0} | |||||
m_PrefabInstance: {fileID: 0} | |||||
m_PrefabAsset: {fileID: 0} | |||||
serializedVersion: 6 | |||||
m_Component: | |||||
- component: {fileID: 3452914372860290207} | |||||
- component: {fileID: 8586933507933314822} | |||||
m_Layer: 0 | |||||
m_Name: WeChatLogin | |||||
m_TagString: Untagged | |||||
m_Icon: {fileID: 0} | |||||
m_NavMeshLayer: 0 | |||||
m_StaticEditorFlags: 0 | |||||
m_IsActive: 1 | |||||
--- !u!4 &3452914372860290207 | |||||
Transform: | |||||
m_ObjectHideFlags: 0 | |||||
m_CorrespondingSourceObject: {fileID: 0} | |||||
m_PrefabInstance: {fileID: 0} | |||||
m_PrefabAsset: {fileID: 0} | |||||
m_GameObject: {fileID: 3375001057570166699} | |||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | |||||
m_LocalPosition: {x: 0, y: 0, z: 0} | |||||
m_LocalScale: {x: 1, y: 1, z: 1} | |||||
m_Children: [] | |||||
m_Father: {fileID: 0} | |||||
m_RootOrder: 0 | |||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | |||||
--- !u!114 &8586933507933314822 | |||||
MonoBehaviour: | |||||
m_ObjectHideFlags: 0 | |||||
m_CorrespondingSourceObject: {fileID: 0} | |||||
m_PrefabInstance: {fileID: 0} | |||||
m_PrefabAsset: {fileID: 0} | |||||
m_GameObject: {fileID: 3375001057570166699} | |||||
m_Enabled: 1 | |||||
m_EditorHideFlags: 0 | |||||
m_Script: {fileID: 11500000, guid: ae686ed626ce4f844bd3b8a007577ae7, type: 3} | |||||
m_Name: | |||||
m_EditorClassIdentifier: |
@@ -1,7 +1,6 @@ | |||||
fileFormatVersion: 2 | fileFormatVersion: 2 | ||||
guid: 75ce4ac6d640fe34d9991fe8e8b4273a | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
guid: 9b0f4d97ae0b01149a8ba8adb6bd35e2 | |||||
PrefabImporter: | |||||
externalObjects: {} | externalObjects: {} | ||||
userData: | userData: | ||||
assetBundleName: | assetBundleName: |