Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
87 lines
1.9 KiB
C#
87 lines
1.9 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace Wizard;
|
|
|
|
public static class ToolboxGame
|
|
{
|
|
private enum SYSTEM_INIT
|
|
{
|
|
SYSTEM_NOT_READY,
|
|
SYSTEM_READY
|
|
}
|
|
|
|
public static SetUp SetUp = null;
|
|
|
|
public static UIManager UIManager = null;
|
|
|
|
public static GameMgr GameManager = null;
|
|
|
|
public static bool isLoadFromLocal = false;
|
|
|
|
public static bool isLoadLocalSound = false;
|
|
|
|
public static bool bDebugLogMode = true;
|
|
|
|
private static Transform _gameTransform = null;
|
|
|
|
public static RealTimeNetworkAgent RealTimeNetworkAgent { get; private set; }
|
|
|
|
public static Transform GameTransform
|
|
{
|
|
get
|
|
{
|
|
if (!_gameTransform)
|
|
{
|
|
GameObject gameObject = GameObject.Find("_Game");
|
|
if ((bool)gameObject)
|
|
{
|
|
_gameTransform = gameObject.transform;
|
|
}
|
|
}
|
|
return _gameTransform;
|
|
}
|
|
}
|
|
|
|
public static void Clear()
|
|
{
|
|
UIManager = null;
|
|
GameManager = null;
|
|
}
|
|
|
|
public static void ClearUIManager()
|
|
{
|
|
UIManager = null;
|
|
}
|
|
|
|
public static void SetRealTimeNetworkBattle(RealTimeNetworkAgent agent)
|
|
{
|
|
RealTimeNetworkAgent = agent;
|
|
}
|
|
|
|
public static void DestroyNetworkAgent()
|
|
{
|
|
if (RealTimeNetworkAgent != null)
|
|
{
|
|
Object.DestroyImmediate(RealTimeNetworkAgent.gameObject);
|
|
RealTimeNetworkAgent = null;
|
|
}
|
|
}
|
|
|
|
public static IEnumerator CreateRealTimeNetworkBattleAgent(Matching matching = null)
|
|
{
|
|
string loadObjectPath = "TurnBase/_TurnBaseManager";
|
|
if (GameMgr.GetIns().IsAINetwork)
|
|
{
|
|
loadObjectPath = "TurnBase/_AINetworkBaseManager";
|
|
}
|
|
yield return BattleCoroutine.GetInstance().StartCoroutine(GameMgr.GetIns().GetPrefabMgr().LoadAync(loadObjectPath));
|
|
NGUITools.AddChild(GameObject.Find("_Game"), GameMgr.GetIns().GetPrefabMgr().Get(loadObjectPath));
|
|
yield return null;
|
|
if (matching != null)
|
|
{
|
|
RealTimeNetworkAgent.SettingMatchingClass(matching);
|
|
}
|
|
}
|
|
}
|