Merge remote-tracking branch 'refs/remotes/origin/taptap'
# Conflicts: # Assets/000_assets/material/M_SquareFrame 1.mat # Assets/FR2_Cache.asset # Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset # Packages/packages-lock.json # ProjectSettings/PackageManagerSettings.asset # ProjectSettings/ProjectSettings.asset # UserSettings/Layouts/CurrentMaximizeLayout.dwlt # UserSettings/Layouts/default-6000.dwlt # ichni Official_WwiseProject/.cache/SoundBankInfoCache.dat # ichni_Official.slnx
This commit is contained in:
3
Assets/Scripts/Online.meta
Normal file
3
Assets/Scripts/Online.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cd5753e721a43d49cb651f2c5479bac
|
||||
timeCreated: 1777005537
|
||||
3
Assets/Scripts/Online/Logic.meta
Normal file
3
Assets/Scripts/Online/Logic.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a90bb157de744750b0c7ca5b7f8b21ba
|
||||
timeCreated: 1777007121
|
||||
68
Assets/Scripts/Online/Logic/ThirdPartyServiceManager.cs
Normal file
68
Assets/Scripts/Online/Logic/ThirdPartyServiceManager.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Ichni.RhythmGame;
|
||||
using Sirenix.OdinInspector;
|
||||
using TapSDK.Core;
|
||||
using TapSDK.Login;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Online.Logic
|
||||
{
|
||||
public class ThirdPartyServiceManager:SerializedMonoBehaviour
|
||||
{
|
||||
public static ThirdPartyServiceManager Instance { get; private set; } = null!;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// 核心配置 详细参数见 [TapTapSDK]
|
||||
TapTapSdkOptions coreOptions = new TapTapSdkOptions()
|
||||
{
|
||||
clientId = "hkbfpbh2jv2kbxupmo",
|
||||
clientToken = "Cry8OrA9EmfAetgu1RduPrWntgba2Qt44uC5tfEB",
|
||||
region = TapTapRegionType.Overseas,
|
||||
preferredLanguage = TapTapLanguageType.en,
|
||||
enableLog = true
|
||||
};
|
||||
// TapSDK 初始化
|
||||
TapTapSDK.Init(coreOptions);
|
||||
TapTapLoginTest();
|
||||
}
|
||||
|
||||
async Task TapTapLoginTest()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 定义授权范围
|
||||
List<string> scopes = new List<string>
|
||||
{
|
||||
TapTapLogin.TAP_LOGIN_SCOPE_PUBLIC_PROFILE,
|
||||
TapTapLogin.TAP_LOGIN_SCOPE_EMAIL
|
||||
};
|
||||
// 发起 Tap 登录
|
||||
var userInfo = await TapTapLogin.Instance.LoginWithScopes(scopes.ToArray());
|
||||
Debug.Log($"登录成功,当前用户 ID:{JsonUtility.ToJson(userInfo.accessToken)}");
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
Debug.Log("用户取消登录");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Debug.Log($"登录失败,出现异常:{exception}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 656278590545491483e2e888078b504e
|
||||
timeCreated: 1777007160
|
||||
3
Assets/Scripts/Online/Models.meta
Normal file
3
Assets/Scripts/Online/Models.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bac26c98fb9d45778f0a351adbbb33e8
|
||||
timeCreated: 1777005546
|
||||
48
Assets/Scripts/Online/Models/OnlineEnumeration.cs
Normal file
48
Assets/Scripts/Online/Models/OnlineEnumeration.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
namespace Online.Models
|
||||
{
|
||||
public enum UserPermission
|
||||
{
|
||||
Guest = 0,
|
||||
Player = 1,
|
||||
Admin = 2
|
||||
}
|
||||
|
||||
public enum BeatmapStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 已发布并且可用
|
||||
/// </summary>
|
||||
Public = 0,
|
||||
/// <summary>
|
||||
/// 未发布
|
||||
/// </summary>
|
||||
Private = 1,
|
||||
/// <summary>
|
||||
/// 定时发布
|
||||
/// </summary>
|
||||
Scheduled = 2,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 游戏将要发布的平台
|
||||
/// </summary>
|
||||
public enum GamePublishPlatform
|
||||
{
|
||||
TapTapInternational = 0,
|
||||
GooglePlay = 1,
|
||||
AppStore = 2,
|
||||
Steam = 3
|
||||
}
|
||||
|
||||
public enum ThirdPartyDataStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 等待用户注册或绑定账号/用户删除等情况
|
||||
/// </summary>
|
||||
Unavailable = 0,
|
||||
/// <summary>
|
||||
/// 正常可用
|
||||
/// </summary>
|
||||
Available = 1
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Online/Models/OnlineEnumeration.cs.meta
Normal file
3
Assets/Scripts/Online/Models/OnlineEnumeration.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 861c1de6a1154e3fa51b1d28f79ff932
|
||||
timeCreated: 1777005936
|
||||
Reference in New Issue
Block a user