68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using BingoBrain;
|
|
using Unity.VisualScripting.FullSerializer;
|
|
using Unity.VisualScripting;
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
namespace DontConfuse
|
|
{
|
|
public class SdkManager : MonoBehaviour
|
|
{
|
|
private static SdkManager _instance;
|
|
|
|
public static SdkManager Instance
|
|
{
|
|
get
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
_instance = FindFirstObjectByType<SdkManager>();
|
|
if (_instance == null)
|
|
{
|
|
Debug.LogError("场景中没有找到挂载 SdkManager 的物体!请确保场景中有一个 GameObject 挂载了该脚本。");
|
|
}
|
|
}
|
|
return _instance;
|
|
}
|
|
}
|
|
private void Awake()
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
_instance = this;
|
|
DontDestroyOnLoad(gameObject);
|
|
}
|
|
else if (_instance != this)
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
public static void OpenSDK()//初始化sdk
|
|
{
|
|
LoginSystem_sdk.Instance.RequestLogin();
|
|
}
|
|
|
|
public static void Enable()//重新启用sdk
|
|
{
|
|
SDKScript.Instance.SetEnable(true);
|
|
}
|
|
public static void Disable()//禁用sdk
|
|
{
|
|
SDKScript.Instance.SetEnable(false);
|
|
}
|
|
public void UpdateNumbers(string string_)
|
|
{
|
|
SDKScript.Instance.UpdateNumbers(string_);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|