feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
96
SVSim.BattleEngine/Engine/RedShellUnity/RedShell.cs
Normal file
96
SVSim.BattleEngine/Engine/RedShellUnity/RedShell.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using com.adjust.sdk;
|
||||
using RedShellSDK;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RedShellUnity;
|
||||
|
||||
public class RedShell : MonoBehaviour
|
||||
{
|
||||
private static RedShell instance;
|
||||
|
||||
private static bool quitting;
|
||||
|
||||
private static bool verboseLogs;
|
||||
|
||||
public static void SetApiKey(string apiKey)
|
||||
{
|
||||
if (!Adjust.IsEditor())
|
||||
{
|
||||
_ = verboseLogs;
|
||||
setupInstance();
|
||||
global::RedShellSDK.RedShellSDK.SetApiKey(apiKey);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetUserId(string userId)
|
||||
{
|
||||
if (!Adjust.IsEditor())
|
||||
{
|
||||
_ = verboseLogs;
|
||||
setupInstance();
|
||||
global::RedShellSDK.RedShellSDK.SetUserId(userId);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetVerboseLogs(bool verboseLogs)
|
||||
{
|
||||
if (!Adjust.IsEditor())
|
||||
{
|
||||
RedShell.verboseLogs = verboseLogs;
|
||||
setupInstance();
|
||||
global::RedShellSDK.RedShellSDK.SetVerboseLogs(verboseLogs);
|
||||
}
|
||||
}
|
||||
|
||||
public static void MarkConversion()
|
||||
{
|
||||
if (!Adjust.IsEditor())
|
||||
{
|
||||
_ = verboseLogs;
|
||||
setupInstance();
|
||||
instance.StartCoroutine(global::RedShellSDK.RedShellSDK.MarkConversion());
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogEvent(string type)
|
||||
{
|
||||
if (!Adjust.IsEditor())
|
||||
{
|
||||
_ = verboseLogs;
|
||||
setupInstance();
|
||||
instance.StartCoroutine(global::RedShellSDK.RedShellSDK.LogEvent(type));
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (!Adjust.IsEditor())
|
||||
{
|
||||
if (instance != null)
|
||||
{
|
||||
Object.Destroy(base.gameObject.GetComponent<RedShell>());
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
Object.DontDestroyOnLoad(base.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (!(instance != this))
|
||||
{
|
||||
quitting = true;
|
||||
instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void setupInstance()
|
||||
{
|
||||
if (!Adjust.IsEditor() && !quitting && instance == null)
|
||||
{
|
||||
_ = verboseLogs;
|
||||
instance = new GameObject("Red Shell").AddComponent<RedShell>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user