12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using ET;
- using TapTap.Bootstrap;
- using TapTap.Common;
- using TapTap.TapDB;
- namespace GFGGame
- {
- public class PlatformTapManager
- {
- public static void InitSDK()
- {
- if (!PlatformManager.IsTaptap)
- {
- return;
- }
- var config = new TapConfig.Builder()
- .ClientID("K7bDyPGYlVx2AAtk6q")
- .ClientToken("fjwWBtibB4Dj3UjyRQxK2tZ3f8fGNgg14tcRW38D")
- .ServerURL("https://k7bdypgy.cloud.tds1.tapapis.cn")
- .RegionType(RegionType.CN)
- .TapDBConfig(true, "tap", null, true)
- .ConfigBuilder();
- TapBootstrap.Init(config);
-
- }
- public static void OnEnterGame()
- {
- if(!PlatformManager.IsTaptap)
- {
- return;
- }
- var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
- var accountInfoComponent = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>();
- var roleInfosComponent = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>();
- var currentRole = roleInfosComponent.GetCurrentRole();
- TapDB.SetUser(accountInfoComponent.Account);
- TapDB.SetName(currentRole.Name);
- TapDB.SetLevel(RoleDataManager.lvl);
- TapDB.SetServer(serverInfosComponent.GetCurrentServerInfo().ServerName);
- }
- public static void OnQuitGame()
- {
- if (!PlatformManager.IsTaptap)
- {
- return;
- }
- TapDB.ClearUser();
- }
- }
- }
|