Files
Main/Assets/Plugins/References/FuncellSDK/SDK/SDKInitialize.cs
2025-01-25 04:38:09 +08:00

68 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
using Thousandto.CoreSDK.Event;
using Thousandto.CoreSDK;
namespace Thousandto.CoreSDK
{
/// <summary>
/// SDK初始化操作注册一些事件
/// 这是常规SDK包含账号系统充值系统不包含数据统计功能
/// </summary>
public class SDKInitialize
{
//运行时平台
public static MyRuntimePlatform RumtimePlatform = MyRuntimePlatform.None;
private static SDKInitialize _instance;
public static SDKInitialize Instance
{
get
{
if (_instance == null)
{
_instance = new SDKInitialize();
Application.logMessageReceived += LogCallback;
}
return SDKInitialize._instance;
}
}
private SDKInitialize()
{
}
public static void LogCallback(string condition, string stackTrace, LogType type)
{
if(type == LogType.Error || type == LogType.Exception)
{
//LogManager中已经有日志记录了这里没必要
//PlatformInterface.reportCatchedException(condition, stackTrace);
}
}
public static void SetRuntimePlatform(MyRuntimePlatform platform)
{
RumtimePlatform = platform;
switch (platform)
{
case MyRuntimePlatform.AndroidEditor:
case MyRuntimePlatform.IOSEditor:
case MyRuntimePlatform.StandaloneEditor:
SDKBridge.SDKPlatform = SDKPlatform.EDITOR;
break;
case MyRuntimePlatform.Android:
case MyRuntimePlatform.IOS:
SDKBridge.SDKPlatform = SDKPlatform.Normal;
break;
case MyRuntimePlatform.Standalone:
SDKBridge.SDKPlatform = SDKPlatform.PC;
break;
default:
SDKBridge.SDKPlatform = SDKPlatform.EDITOR;
break;
}
}
}
}