Compare commits
2 Commits
6866b7fca9
...
c0b6ccf7ed
| Author | SHA1 | Date | |
|---|---|---|---|
| c0b6ccf7ed | |||
| db82fe0116 |
@@ -38,7 +38,8 @@ namespace tysdk
|
|||||||
{"google", EAccoutType.hwGoogle},
|
{"google", EAccoutType.hwGoogle},
|
||||||
{"fb", EAccoutType.hwFacebook},
|
{"fb", EAccoutType.hwFacebook},
|
||||||
{"tyGuest", EAccoutType.hwGuest},
|
{"tyGuest", EAccoutType.hwGuest},
|
||||||
{"ios13", EAccoutType.Apple}
|
{"ios13", EAccoutType.Apple},
|
||||||
|
{AccountString.hwVkid, EAccoutType.hwVkid}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static EAccoutType ConvertAccoutType(string accountType)
|
private static EAccoutType ConvertAccoutType(string accountType)
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ namespace tysdk
|
|||||||
none
|
none
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class AccountString
|
||||||
|
{
|
||||||
|
public const string hwVkid = "vk.global.app";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class LoginInfo
|
public class LoginInfo
|
||||||
{
|
{
|
||||||
public bool isSuccess;
|
public bool isSuccess;
|
||||||
|
|||||||
@@ -7,7 +7,13 @@ namespace tysdk
|
|||||||
|
|
||||||
public static class UnityBridgeFunc
|
public static class UnityBridgeFunc
|
||||||
{
|
{
|
||||||
|
#if UNITY_EDITOR || UNITY_ANDROID
|
||||||
|
private static string EAccountTypeToStr(EAccoutType accountType)
|
||||||
|
{
|
||||||
|
return accountType == EAccoutType.hwVkid ? AccountString.hwVkid : accountType.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
//初始化sdk
|
//初始化sdk
|
||||||
public static void InitSDK(){}
|
public static void InitSDK(){}
|
||||||
@@ -61,8 +67,6 @@ namespace tysdk
|
|||||||
|
|
||||||
public static void FBShareLink(string title, string content, string url) { }
|
public static void FBShareLink(string title, string content, string url) { }
|
||||||
public static void MessengerShareLink(string title, string content, string url) { }
|
public static void MessengerShareLink(string title, string content, string url) { }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#elif UNITY_ANDROID
|
#elif UNITY_ANDROID
|
||||||
|
|
||||||
@@ -107,10 +111,12 @@ namespace tysdk
|
|||||||
|
|
||||||
public static void UnityLogin(EAccoutType accoutType)
|
public static void UnityLogin(EAccoutType accoutType)
|
||||||
{
|
{
|
||||||
|
var accountInfo = EAccountTypeToStr(accoutType);
|
||||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||||
{
|
{
|
||||||
sdkManager.CallStatic("UnityLogin", accoutType.ToString());
|
sdkManager.CallStatic("UnityLogin",accountInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UnityGetIdentityFun(string type)
|
public static void UnityGetIdentityFun(string type)
|
||||||
@@ -124,18 +130,20 @@ namespace tysdk
|
|||||||
public static void UnityLogOutByChannel(EAccoutType accoutType)
|
public static void UnityLogOutByChannel(EAccoutType accoutType)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var accountInfo = EAccountTypeToStr(accoutType);
|
||||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||||
{
|
{
|
||||||
sdkManager.CallStatic("UnityLogOutByChannel", accoutType.ToString());
|
sdkManager.CallStatic("UnityLogOutByChannel", accountInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LinkAccount(EAccoutType accoutType)
|
public static void LinkAccount(EAccoutType accoutType)
|
||||||
{
|
{
|
||||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
string userId = TYSdkFacade.TYAccountInfo.strUserId;
|
||||||
|
using (var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||||
{
|
{
|
||||||
string userId = TYSdkFacade.TYAccountInfo.strUserId;
|
var accountInfo = EAccountTypeToStr(accoutType);
|
||||||
sdkManager.CallStatic("LinkAccount", accoutType.ToString(), userId);
|
sdkManager.CallStatic("LinkAccount",accountInfo,userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,17 +159,19 @@ namespace tysdk
|
|||||||
|
|
||||||
public static void ChangeLinkAccount(EAccoutType accoutType, int oldUserId, int newUserId)
|
public static void ChangeLinkAccount(EAccoutType accoutType, int oldUserId, int newUserId)
|
||||||
{
|
{
|
||||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
var accountInfo = EAccountTypeToStr(accoutType);
|
||||||
|
using (var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||||
{
|
{
|
||||||
sdkManager.CallStatic("ChangeLinkAccount", accoutType.ToString(), oldUserId, newUserId);
|
sdkManager.CallStatic("ChangeLinkAccount", accountInfo, oldUserId, newUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LinkCheck(EAccoutType accoutType)
|
public static void LinkCheck(EAccoutType accoutType)
|
||||||
{
|
{
|
||||||
|
var accountInfo = EAccountTypeToStr(accoutType);
|
||||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||||
{
|
{
|
||||||
sdkManager.CallStatic("LinkCheck", accoutType.ToString());
|
sdkManager.CallStatic("LinkCheck",accountInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,6 +242,7 @@ namespace tysdk
|
|||||||
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
using(var sdkManager = new AndroidJavaClass(SDK_CLASS))
|
||||||
{
|
{
|
||||||
sdkManager.CallStatic("Review");
|
sdkManager.CallStatic("Review");
|
||||||
|
// sdkManager.CallStataic("RuStoreReview");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user