engine cleanup passes 4-7 + multi-instancing ambient rip

Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed,
+11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer
stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that
turns concurrent battles into a type-system property rather than a scope
contract.

## What landed

**Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a
cascading cull across the skill graph, view layer, and receive-path periphery.
Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/
IsAINetwork) became `const false`, every guarded block deleted. Field*.cs
subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan
family reworked to take a mgr param through IMulliganMgr.InitMulligan.
Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/
skill filters converted from static ambient reads to per-mgr reads via
SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr.

**Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient-
Context / TestBattleScope in full. Every per-battle mutable slot now lives on
the mgr instance itself:
  mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo /
  InstanceViewerId / InstanceNetworkAgent / GameMgr
BattleManagerBase.GetIns() returns null unconditionally; the residual static
flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo,
ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the
handful of engine-internal readers that still reference their types. Zero
BattleAmbient references anywhere in engine + node + tests.

Added pre-seeded GameMgr ctor overload threaded through the mgr chain
(BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard-
BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a
GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it
to the mgr's ctor — no ambient reach.

Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain
GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps
ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr
takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal
BEFORE mgr construction.

Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to
`HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten
around per-mgr construction (GetIns() → null is the pinned invariant).

## Regression fixes

- **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke
  the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream
  of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups
  via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied
  by the WireMulliganPhase seam; unit tests exposed the live-path gap.

## Ship state

- SVSim.BattleEngine.Tests: 56/56 pass, 2 skip
- SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48)
- Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs
  in SVSim.EmulatedEntrypoint, unrelated)
- Sequential PVP smoke: verified live (two back-to-back battles, no regression
  on cleanup/spinup)
- Concurrent PVP smoke: verified live

Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure
analyzer needed to make future cascade cleanup safe (per feedback memory
"Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-03 19:18:54 -04:00
parent 5c1db83967
commit 2d9a6eea4b
2045 changed files with 11704 additions and 158495 deletions

View File

@@ -13,14 +13,11 @@ namespace UnityEngine
public static Vector2 zero => new Vector2(0, 0);
public static Vector2 one => new Vector2(1, 1);
public static Vector2 up => new Vector2(0, 1);
public static Vector2 down => new Vector2(0, -1);
public static Vector2 left => new Vector2(-1, 0);
public static Vector2 right => new Vector2(1, 0);
public float magnitude => (float)Math.Sqrt(x * x + y * y);
public float sqrMagnitude => x * x + y * y;
public Vector2 normalized { get { float m = magnitude; return m > 1e-6f ? new Vector2(x / m, y / m) : zero; } }
public static float Distance(Vector2 a, Vector2 b) => (a - b).magnitude;
public static float Dot(Vector2 a, Vector2 b) => a.x * b.x + a.y * b.y;
public static float Angle(Vector2 from, Vector2 to) => 0f;
public void Normalize() { var n = normalized; x = n.x; y = n.y; }
public static Vector2 Lerp(Vector2 a, Vector2 b, float t) => new Vector2(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);
@@ -58,12 +55,9 @@ namespace UnityEngine
public static float Distance(Vector3 a, Vector3 b) => (a - b).magnitude;
public static float SqrMagnitude(Vector3 a) => a.sqrMagnitude;
public static float Dot(Vector3 a, Vector3 b) => a.x * b.x + a.y * b.y + a.z * b.z;
public static Vector3 Cross(Vector3 a, Vector3 b) => new Vector3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);
public static Vector3 Scale(Vector3 a, Vector3 b) => new Vector3(a.x * b.x, a.y * b.y, a.z * b.z);
public void Scale(Vector3 s) { x *= s.x; y *= s.y; z *= s.z; }
public static Vector3 Lerp(Vector3 a, Vector3 b, float t) => new Vector3(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t);
public static Vector3 LerpUnclamped(Vector3 a, Vector3 b, float t) => Lerp(a, b, t);
public static Vector3 MoveTowards(Vector3 a, Vector3 b, float d) => b;
public static Vector3 operator +(Vector3 a, Vector3 b) => new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);
public static Vector3 operator -(Vector3 a, Vector3 b) => new Vector3(a.x - b.x, a.y - b.y, a.z - b.z);
public static Vector3 operator -(Vector3 a) => new Vector3(-a.x, -a.y, -a.z);
@@ -84,10 +78,7 @@ namespace UnityEngine
public static Quaternion Euler(float x, float y, float z) => identity;
public static Quaternion Euler(Vector3 e) => identity;
public static Quaternion AngleAxis(float angle, Vector3 axis) => identity;
public static Quaternion LookRotation(Vector3 fwd) => identity;
public static Quaternion Slerp(Quaternion a, Quaternion b, float t) => identity;
public static Quaternion FromToRotation(Vector3 from, Vector3 to) => identity;
public static Quaternion Inverse(Quaternion rotation) => identity;
public Vector3 eulerAngles { get => Vector3.zero; set { } }
public static Vector3 operator *(Quaternion q, Vector3 v) => v;
public static Quaternion operator *(Quaternion a, Quaternion b) => identity;
@@ -102,11 +93,7 @@ namespace UnityEngine
public static Color black => new Color(0, 0, 0, 1);
public static Color clear => new Color(0, 0, 0, 0);
public static Color red => new Color(1, 0, 0, 1);
public static Color green => new Color(0, 1, 0, 1);
public static Color blue => new Color(0, 0, 1, 1);
public static Color yellow => new Color(1, 0.92f, 0.016f, 1);
public static Color cyan => new Color(0, 1, 1, 1);
public static Color magenta => new Color(1, 0, 1, 1);
public static Color gray => new Color(0.5f, 0.5f, 0.5f, 1);
public static Color grey => gray;
public static Color Lerp(Color a, Color b, float t) => new Color(a.r + (b.r - a.r) * t, a.g + (b.g - a.g) * t, a.b + (b.b - a.b) * t, a.a + (b.a - a.a) * t);
@@ -125,16 +112,9 @@ namespace UnityEngine
public static class Mathf
{
public const float PI = 3.14159265f;
public const float Infinity = float.PositiveInfinity;
public const float NegativeInfinity = float.NegativeInfinity;
public const float Epsilon = 1.401298E-45f;
public const float Deg2Rad = PI / 180f;
public const float Rad2Deg = 180f / PI;
public static float Floor(float f) => (float)Math.Floor(f);
public static int FloorToInt(float f) => (int)Math.Floor(f);
public static float Ceil(float f) => (float)Math.Ceiling(f);
public static int CeilToInt(float f) => (int)Math.Ceiling(f);
public static float Round(float f) => (float)Math.Round(f);
public static int RoundToInt(float f) => (int)Math.Round(f);
public static float Abs(float f) => Math.Abs(f);
@@ -151,45 +131,23 @@ namespace UnityEngine
public static int Clamp(int v, int lo, int hi) => Math.Max(lo, Math.Min(hi, v));
public static float Clamp01(float v) => Math.Max(0f, Math.Min(1f, v));
public static float Lerp(float a, float b, float t) => a + (b - a) * Clamp01(t);
public static float LerpUnclamped(float a, float b, float t) => a + (b - a) * t;
public static float LerpAngle(float a, float b, float t) => a + (b - a) * Clamp01(t);
public static float MoveTowards(float a, float b, float d) => b;
public static float SmoothDamp(float cur, float target, ref float vel, float time) { vel = 0; return target; }
public static float SmoothDamp(float cur, float target, ref float vel, float time, float maxSpeed) { vel = 0; return target; }
public static float SmoothDampAngle(float cur, float target, ref float vel, float time) { vel = 0; return target; }
public static float SmoothStep(float a, float b, float t) => Lerp(a, b, t);
public static float Sin(float f) => (float)Math.Sin(f);
public static float Cos(float f) => (float)Math.Cos(f);
public static float Tan(float f) => (float)Math.Tan(f);
public static float Asin(float f) => (float)Math.Asin(f);
public static float Acos(float f) => (float)Math.Acos(f);
public static float Atan(float f) => (float)Math.Atan(f);
public static float Atan2(float y, float x) => (float)Math.Atan2(y, x);
public static float Sqrt(float f) => (float)Math.Sqrt(f);
public static float Pow(float f, float p) => (float)Math.Pow(f, p);
public static float Exp(float f) => (float)Math.Exp(f);
public static float Log(float f) => (float)Math.Log(f);
public static float Log(float f, float b) => (float)Math.Log(f, b);
public static float Log10(float f) => (float)Math.Log10(f);
public static float Sign(float f) => Math.Sign(f);
public static bool Approximately(float a, float b) => Math.Abs(a - b) < 1e-6f;
public static float Repeat(float t, float length) => t - Floor(t / length) * length;
public static float PingPong(float t, float length) => length - Math.Abs(Repeat(t, length * 2) - length);
public static float DeltaAngle(float a, float b) => Repeat(b - a + 180f, 360f) - 180f;
public static float GammaToLinearSpace(float v) => v;
public static float LinearToGammaSpace(float v) => v;
}
public static class Debug
{
public static void Log(object m) { }
public static void LogFormat(string m, params object[] a) { }
public static void LogWarning(object m) { }
public static void LogError(object m) { }
public static void LogException(Exception e) { }
public static void Assert(bool c) { }
public static void DrawLine(Vector3 a, Vector3 b) { }
public static void DrawRay(Vector3 a, Vector3 b) { }
public static bool isDebugBuild => false;
}
}

View File

@@ -10,23 +10,12 @@ namespace UnityEngine
public static Vector3 mousePosition => Vector3.zero;
public static Vector2 mouseScrollDelta => Vector2.zero;
public static int touchCount => 0;
public static Touch[] touches => new Touch[0];
public static Touch GetTouch(int i) => default;
public static bool anyKey => false;
public static bool anyKeyDown => false;
public static bool mousePresent => false;
public static bool GetMouseButton(int b) => false;
public static bool GetMouseButtonDown(int b) => false;
public static bool GetMouseButtonUp(int b) => false;
public static bool GetKey(KeyCode k) => false;
public static bool GetKey(string n) => false;
public static bool GetKeyDown(KeyCode k) => false;
public static bool GetKeyDown(string n) => false;
public static bool GetKeyUp(KeyCode k) => false;
public static bool GetButton(string n) => false;
public static bool GetButtonDown(string n) => false;
public static float GetAxis(string n) => 0f;
public static float GetAxisRaw(string n) => 0f;
public static string inputString => "";
public static bool multiTouchEnabled { get; set; }
}
@@ -36,14 +25,8 @@ namespace UnityEngine
public static float value => 0f;
public static int Range(int minInclusive, int maxExclusive) => minInclusive;
public static float Range(float min, float max) => min;
public static Vector2 insideUnitCircle => Vector2.zero;
public static Vector3 insideUnitSphere => Vector3.zero;
public static Vector3 onUnitSphere => Vector3.up;
public static Quaternion rotation => Quaternion.identity;
public static Quaternion rotationUniform => Quaternion.identity;
public static int seed { get; set; }
public static void InitState(int s) { }
public static Color ColorHSV() => Color.white;
}
public static partial class Resources
@@ -63,11 +46,7 @@ namespace UnityEngine
return _loaded.GetOrAdd(path, static p => new GameObject(p));
}
public static Object Load(string path, Type t) => Load(path);
public static T[] LoadAll<T>(string path) where T : Object => new T[0];
public static Object[] LoadAll(string path) => new Object[0];
public static ResourceRequest LoadAsync<T>(string path) where T : Object => null;
public static ResourceRequest LoadAsync(string path) => null;
public static void UnloadAsset(Object o) { }
public static AsyncOperation UnloadUnusedAssets() => null;
}
@@ -75,32 +54,5 @@ namespace UnityEngine
public enum KeyCode
{
None = 0,
Backspace = 8, Tab = 9, Clear = 12, Return = 13, Pause = 19, Escape = 27, Space = 32,
Exclaim = 33, DoubleQuote = 34, Hash = 35, Dollar = 36, Ampersand = 38, Quote = 39,
LeftParen = 40, RightParen = 41, Asterisk = 42, Plus = 43, Comma = 44, Minus = 45,
Period = 46, Slash = 47,
Alpha0 = 48, Alpha1, Alpha2, Alpha3, Alpha4, Alpha5, Alpha6, Alpha7, Alpha8, Alpha9,
Colon = 58, Semicolon = 59, Less = 60, Equals = 61, Greater = 62, Question = 63, At = 64,
LeftBracket = 91, Backslash = 92, RightBracket = 93, Caret = 94, Underscore = 95, BackQuote = 96,
A = 97, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
LeftCurlyBracket = 123, Pipe = 124, RightCurlyBracket = 125, Tilde = 126, Delete = 127,
Keypad0 = 256, Keypad1, Keypad2, Keypad3, Keypad4, Keypad5, Keypad6, Keypad7, Keypad8, Keypad9,
KeypadPeriod = 266, KeypadDivide = 267, KeypadMultiply = 268, KeypadMinus = 269,
KeypadPlus = 270, KeypadEnter = 271, KeypadEquals = 272,
UpArrow = 273, DownArrow = 274, RightArrow = 275, LeftArrow = 276,
Insert = 277, Home = 278, End = 279, PageUp = 280, PageDown = 281,
F1 = 282, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15,
Numlock = 300, CapsLock = 301, ScrollLock = 302,
RightShift = 303, LeftShift = 304, RightControl = 305, LeftControl = 306,
RightAlt = 307, LeftAlt = 308, RightCommand = 309, LeftCommand = 310,
LeftWindows = 311, RightWindows = 312, AltGr = 313,
Help = 315, Print = 316, SysReq = 317, Break = 318, Menu = 319,
Mouse0 = 323, Mouse1, Mouse2, Mouse3, Mouse4, Mouse5, Mouse6,
JoystickButton0 = 330, JoystickButton1, JoystickButton2, JoystickButton3,
JoystickButton4, JoystickButton5, JoystickButton6, JoystickButton7,
JoystickButton8, JoystickButton9, JoystickButton10, JoystickButton11,
JoystickButton12, JoystickButton13, JoystickButton14, JoystickButton15,
JoystickButton16, JoystickButton17, JoystickButton18, JoystickButton19
}
None = 0, Tab = 9, Return = 13, Escape = 27, Alpha0 = 48, A = 97, B, D, E, F, N, P, S, X, RightArrow = 275, LeftArrow = 276, RightShift = 303, LeftShift = 304, RightControl = 305, LeftControl = 306, Mouse0 = 323, JoystickButton0 = 330, JoystickButton1 }
}

View File

@@ -17,12 +17,8 @@ namespace UnityEngine
public Vector3 extents { get => size * 0.5f; set => size = value * 2f; }
public Vector3 min { get => center - extents; set { } }
public Vector3 max { get => center + extents; set { } }
public bool Contains(Vector3 p) => false;
public void Encapsulate(Vector3 p) { }
public void Encapsulate(Bounds b) { }
public void Expand(float amount) { }
public bool Intersects(Bounds b) => false;
public float SqrDistance(Vector3 p) => 0f;
}
public struct Rect
{
@@ -32,25 +28,18 @@ namespace UnityEngine
public float yMin { get => y; set { height += y - value; y = value; } }
public float xMax { get => x + width; set => width = value - x; }
public float yMax { get => y + height; set => height = value - y; }
public Vector2 center { get => new Vector2(x + width / 2, y + height / 2); set { } }
public Vector2 size { get => new Vector2(width, height); set { width = value.x; height = value.y; } }
public Vector2 position { get => new Vector2(x, y); set { x = value.x; y = value.y; } }
public Vector2 min { get => new Vector2(xMin, yMin); set { } }
public Vector2 max { get => new Vector2(xMax, yMax); set { } }
public bool Contains(Vector2 p) => false;
public bool Contains(Vector3 p) => false;
public bool Overlaps(Rect other) => false;
public static Rect MinMaxRect(float xmin, float ymin, float xmax, float ymax) => new Rect(xmin, ymin, xmax - xmin, ymax - ymin);
public static bool operator ==(Rect a, Rect b) => a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height;
public static bool operator !=(Rect a, Rect b) => !(a == b);
public override bool Equals(object o) => o is Rect r && this == r;
public override int GetHashCode() => x.GetHashCode() ^ (y.GetHashCode() << 2) ^ (width.GetHashCode() << 4) ^ (height.GetHashCode() << 6);
}
public struct Matrix4x4 { public static Matrix4x4 identity => new Matrix4x4(); public Vector3 MultiplyPoint(Vector3 p) => p; public Vector3 MultiplyPoint3x4(Vector3 p) => p; public Vector3 MultiplyVector(Vector3 v) => v; public static Matrix4x4 TRS(Vector3 t, Quaternion r, Vector3 s) => identity; public Matrix4x4 inverse => identity; public static Matrix4x4 operator *(Matrix4x4 a, Matrix4x4 b) => identity; public Vector4 GetColumn(int i) => default; public Vector4 GetRow(int i) => default; public float this[int row, int col] { get => 0f; set { } } }
public struct Matrix4x4 { public static Matrix4x4 identity => new Matrix4x4(); public Vector3 MultiplyPoint3x4(Vector3 p) => p; public Vector3 MultiplyVector(Vector3 v) => v; public static Matrix4x4 operator *(Matrix4x4 a, Matrix4x4 b) => identity; }
public struct Plane { public Plane(Vector3 normal, Vector3 point) { } public Plane(Vector3 inNormal, float d) { } public Plane(Vector3 a, Vector3 b, Vector3 c) { } public bool Raycast(Ray r, out float enter) { enter = 0; return false; } }
public struct Ray { public Ray(Vector3 origin, Vector3 dir) { this.origin = origin; this.direction = dir; } public Vector3 origin; public Vector3 direction; public Vector3 GetPoint(float d) => origin; }
public struct RaycastHit { public Vector3 point; public Vector3 normal; public float distance; public Collider collider; public Transform transform; public GameObject gameObject; }
public struct RaycastHit2D { public Vector3 point; public Vector3 normal; public float distance; public Collider2D collider; public Transform transform; public static implicit operator bool(RaycastHit2D hit) => hit.collider != null; }
public struct RaycastHit { public Vector3 point; public Vector3 normal; public float distance; public Collider collider; }
public struct LayerMask { public int value; public static int NameToLayer(string n) => 0; public static string LayerToName(int layer) => ""; public static implicit operator int(LayerMask m) => m.value; public static implicit operator LayerMask(int v) => new LayerMask { value = v }; }
// ---- core object model ----
@@ -70,9 +59,7 @@ namespace UnityEngine
public static T Instantiate<T>(T original, Vector3 pos, Quaternion rot) where T : Object => original;
public static T Instantiate<T>(T original, Vector3 pos, Quaternion rot, Transform parent) where T : Object => original;
public static Object Instantiate(Object original) => original;
public static T FindObjectOfType<T>() where T : Object => null;
public static T[] FindObjectsOfType<T>() where T : Object => new T[0];
public static T[] FindObjectsOfType<T>(bool includeInactive) where T : Object => new T[0];
public static Object FindObjectOfType(System.Type t) => null;
public static Object[] FindObjectsOfType(System.Type t) => new Object[0];
public static bool operator ==(Object a, Object b) => ReferenceEquals(a, b);
@@ -95,25 +82,11 @@ namespace UnityEngine
public virtual Transform transform => gameObject.transform;
public string tag { get; set; }
public T GetComponent<T>() => gameObject.GetComponent<T>();
public T GetComponent<T>(string type) => gameObject.GetComponent<T>();
public Component GetComponent(System.Type t) => gameObject.GetComponent(t);
public Component GetComponent(string t) => null;
public T GetComponentInChildren<T>() => default;
public T GetComponentInChildren<T>(bool includeInactive) => default;
public T[] GetComponentsInChildren<T>() => new T[0];
public T[] GetComponentsInChildren<T>(bool includeInactive) => new T[0];
public T GetComponentInParent<T>() => default;
public T GetComponentInParent<T>(bool includeInactive) => default;
public T[] GetComponentsInParent<T>() => new T[0];
public T[] GetComponents<T>() => new T[0];
public Component[] GetComponents(System.Type t) => new Component[0];
public void SendMessage(string method) { }
public void SendMessage(string method, object value) { }
public void SendMessage(string method, object value, SendMessageOptions options) { }
public void SendMessage(string method, SendMessageOptions options) { }
public void BroadcastMessage(string method) { }
public void BroadcastMessage(string method, object parameter) { }
public void BroadcastMessage(string method, object parameter, SendMessageOptions options) { }
public bool CompareTag(string t) => false;
}
@@ -121,7 +94,6 @@ namespace UnityEngine
public class MonoBehaviour : Behaviour
{
public static void print(object message) { }
public Coroutine StartCoroutine(IEnumerator routine) => null;
public Coroutine StartCoroutine(string methodName) => null;
public void StopCoroutine(IEnumerator routine) { }
@@ -129,9 +101,6 @@ namespace UnityEngine
public void StopCoroutine(string methodName) { }
public void StopAllCoroutines() { }
public void Invoke(string methodName, float time) { }
public void CancelInvoke() { }
public void CancelInvoke(string methodName) { }
public bool IsInvoking() => false;
}
public partial class Transform : Component, IEnumerable
@@ -167,30 +136,17 @@ namespace UnityEngine
public void SetSiblingIndex(int i) { }
public int GetSiblingIndex() => 0;
public void SetAsLastSibling() { }
public void SetAsFirstSibling() { }
public Vector3 lossyScale => Vector3.one;
public Vector3 forward { get => Vector3.forward; set { } }
public Vector3 up { get => Vector3.up; set { } }
public Vector3 right { get => Vector3.right; set { } }
public Transform root => this;
public Vector3 TransformPoint(Vector3 p) => p;
public Vector3 TransformPoint(float x, float y, float z) => new Vector3(x, y, z);
public Vector3 InverseTransformPoint(Vector3 p) => p;
public Vector3 InverseTransformPoint(float x, float y, float z) => new Vector3(x, y, z);
public Vector3 TransformDirection(Vector3 d) => d;
public Vector3 InverseTransformDirection(Vector3 d) => d;
public Vector3 TransformVector(Vector3 v) => v;
public Vector3 InverseTransformVector(Vector3 v) => v;
public void Translate(Vector3 t) { }
public void Translate(float x, float y, float z) { }
public void Rotate(Vector3 e) { }
public void Rotate(float x, float y, float z) { }
public void RotateAround(Vector3 point, Vector3 axis, float angle) { }
public void LookAt(Transform t) { }
public void LookAt(Transform t, Vector3 worldUp) { }
public void LookAt(Vector3 p) { }
public void LookAt(Vector3 p, Vector3 worldUp) { }
public void DetachChildren() { }
public Transform Find(string n, bool includeInactive) => Find(n);
public IEnumerator GetEnumerator() { yield break; }
}
@@ -280,33 +236,18 @@ namespace UnityEngine
}
}
public T GetComponent<T>() => (T)(GetOrAddComponent(typeof(T)) ?? default(T));
public Component GetComponent(Type t) => (Component)GetOrAddComponent(t);
public Component GetComponent(string t) => null;
public T GetComponentInChildren<T>() => default;
public T GetComponentInChildren<T>(bool includeInactive) => default;
public T[] GetComponentsInChildren<T>() => new T[0];
public T[] GetComponentsInChildren<T>(bool includeInactive) => new T[0];
public T GetComponentInParent<T>() => default;
public T GetComponentInParent<T>(bool includeInactive) => default;
public T[] GetComponents<T>() => new T[0];
public Component[] GetComponents(Type t) => new Component[0];
public T AddComponent<T>() where T : Component => (T)(GetOrAddComponent(typeof(T)) ?? default(T));
public Component AddComponent(Type t) => (Component)GetOrAddComponent(t);
public void SendMessage(string method) { }
public void SendMessage(string method, object value) { }
public void SendMessage(string method, object value, SendMessageOptions options) { }
public void SendMessage(string method, SendMessageOptions options) { }
public void BroadcastMessage(string method) { }
public void BroadcastMessage(string method, object parameter) { }
public void BroadcastMessage(string method, object parameter, SendMessageOptions options) { }
public bool CompareTag(string t) => false;
public static GameObject Find(string n) => null;
public static GameObject FindGameObjectWithTag(string t) => null;
public static GameObject[] FindGameObjectsWithTag(string t) => new GameObject[0];
}
public class ScriptableObject : Object { }
// Factory for no-op view/manager objects that are NOT acquired via GameObject.GetComponent (e.g.
// UIManager.getUIBase_CardManager()). Creates the instance and runs the same field-wiring the
// component model applies, so the copied cosmetic helpers it exposes resolve headless.
@@ -327,45 +268,30 @@ namespace UnityEngine
public Material[] materials { get; set; }
public Material sharedMaterial { get; set; }
public Material[] sharedMaterials { get; set; }
public bool enabled { get; set; }
public bool isVisible => false;
public int sortingOrder { get; set; }
public string sortingLayerName { get; set; }
public int sortingLayerID { get; set; }
public Bounds bounds => default;
public ShadowCastingMode shadowCastingMode { get; set; }
public bool receiveShadows { get; set; }
}
public enum ShadowCastingMode { Off, On, TwoSided, ShadowsOnly }
public class MeshRenderer : Renderer { }
public class SkinnedMeshRenderer : Renderer { public Mesh sharedMesh { get; set; } public Transform rootBone { get; set; } public Transform[] bones { get; set; } }
public class SpriteRenderer : Renderer { public Sprite sprite { get; set; } public Color color { get; set; } }
public class SkinnedMeshRenderer : Renderer { }
public class SpriteRenderer : Renderer { public Color color { get; set; } }
public class MeshFilter : Component { public Mesh mesh { get; set; } public Mesh sharedMesh { get; set; } }
public class ParticleSystem : Component
{
public void Play() { } public void Play(bool withChildren) { }
public void Stop() { } public void Stop(bool withChildren) { }
public void Pause() { } public void Clear() { } public void Clear(bool withChildren) { }
public void Simulate(float t) { }
public bool isPlaying => false; public bool isPaused => false; public bool isStopped => true;
public bool IsAlive() => false; public bool IsAlive(bool withChildren) => false;
public int particleCount => 0;
public void Clear() { } public int particleCount => 0;
public MainModule main => default;
public EmissionModule emission => default;
public int GetParticles(Particle[] p) => 0;
public void SetParticles(Particle[] p, int n) { }
public struct MainModule { public float duration; public float startLifetime; public bool loop; public float startSpeed; public bool playOnAwake; public float simulationSpeed; public MinMaxGradient startColor; }
public struct MainModule { public bool playOnAwake; public float simulationSpeed; public MinMaxGradient startColor; }
public struct MinMaxGradient { public Color color; public MinMaxGradient(Color c) { color = c; } public static implicit operator MinMaxGradient(Color c) => new MinMaxGradient(c); }
public struct EmissionModule { public bool enabled; public float rateOverTime; }
public struct Particle { public Vector3 position; public Vector3 velocity; public Color32 startColor; public float remainingLifetime; }
public struct EmissionModule { }
public struct Particle { public Vector3 position; public Color32 startColor; }
}
public class ParticleSystemRenderer : Renderer { public SpriteMaskInteraction maskInteraction { get; set; } public Material trailMaterial { get; set; } }
public enum SpriteMaskInteraction { None, VisibleInsideMask, VisibleOutsideMask }
public class ParticleSystemRenderer : Renderer { }
public partial class LODGroup : Component { }
public class Collider : Component { public bool enabled { get; set; } }
public class BoxCollider : Collider { public Vector3 size { get; set; } public Vector3 center { get; set; } public bool isTrigger { get; set; } }
public class BoxCollider : Collider { public Vector3 size { get; set; } public Vector3 center { get; set; } }
public partial class Rigidbody : Component { }
public class Rigidbody2D : Component { public bool isKinematic { get; set; } }
public partial class Material : Object
{
public Material() { }
@@ -378,63 +304,37 @@ namespace UnityEngine
public Vector2 mainTextureScale { get; set; }
public int renderQueue { get; set; }
public string[] shaderKeywords { get; set; }
public float GetFloat(string n) => 0f;
public int GetInt(string n) => 0;
public Color GetColor(string n) => Color.white;
public Texture GetTexture(string n) => null;
public Vector4 GetVector(string n) => default;
public void SetFloat(string n, float v) { }
public void SetInt(string n, int v) { }
public void SetColor(string n, Color c) { }
public void SetTexture(string n, Texture t) { }
public void SetVector(string n, Vector4 v) { }
public void SetVector(int nameID, Vector4 v) { }
public void SetMatrix(string n, Matrix4x4 m) { }
public void SetTextureOffset(string n, Vector2 o) { }
public void EnableKeyword(string k) { }
public void DisableKeyword(string k) { }
public bool IsKeywordEnabled(string k) => false;
public bool HasProperty(string n) => false;
}
public partial class Mesh : Object { public Vector3[] vertices { get; set; } public int[] triangles { get; set; } public void Clear() { } public void RecalculateBounds() { } }
public class Texture : Object { public int width => 0; public int height => 0; }
public partial class Texture2D : Texture { public Texture2D(int w, int h) { } public Texture2D(int w, int h, TextureFormat format, bool mipChain) { } public void Apply() { } public Color GetPixel(int x, int y) => Color.white; public void SetPixel(int x, int y, Color c) { } }
public enum FilterMode { Point, Bilinear, Trilinear }
public enum TextureWrapMode { Repeat, Clamp, Mirror, MirrorOnce }
public enum WrapMode { Once = 1, Loop = 2, PingPong = 4, Default = 0, ClampForever = 8, Clamp = 1 }
public partial class Texture2D : Texture { public Texture2D(int w, int h) { } public Texture2D(int w, int h, TextureFormat format, bool mipChain) { } public void Apply() { } public void SetPixel(int x, int y, Color c) { } }
public enum WrapMode { Once = 1, Default = 0}
public struct Keyframe { public float time; public float value; public float inTangent; public float outTangent; public Keyframe(float t, float v) { time = t; value = v; inTangent = 0; outTangent = 0; } public Keyframe(float t, float v, float inT, float outT) { time = t; value = v; inTangent = inT; outTangent = outT; } }
public struct AnimatorStateInfo { public bool IsName(string name) => false; public float normalizedTime => 0f; public int shortNameHash => 0; public int fullPathHash => 0; public float length => 0f; }
public struct AnimatorClipInfo { public AnimationClip clip => null; public float weight => 0f; }
public class RenderTexture : Texture { public RenderTexture(int w, int h, int depth) { } public RenderTexture(int w, int h, int depth, RenderTextureFormat fmt) { } public void Create() { } public void Release() { } public bool IsCreated() => false; public static RenderTexture active { get; set; } public int depth { get; set; } public FilterMode filterMode { get; set; } public TextureWrapMode wrapMode { get; set; } public void DiscardContents() { } public static RenderTexture GetTemporary(int w, int h) => null; public static RenderTexture GetTemporary(int w, int h, int depth) => null; public static RenderTexture GetTemporary(int w, int h, int depth, RenderTextureFormat fmt) => null; public static void ReleaseTemporary(RenderTexture rt) { } }
public partial class Sprite : Object { public Rect rect => default; public Texture2D texture => null; public static Sprite Create(Texture2D t, Rect r, Vector2 pivot) => null; }
public partial class Shader : Object { public static Shader Find(string n) => null; public bool isSupported => true; }
public class AnimationClip : Object { public float length => 0f; public string name { get; set; } public float frameRate => 0f; }
public partial class Animation : Component, IEnumerable { public AnimationClip clip { get; set; } public bool isPlaying => false; public void Play() { } public void Play(string n) { } public void Stop() { } public IEnumerator GetEnumerator() { yield break; } public AnimationState this[string name] => null; }
public struct AnimatorStateInfo { public bool IsName(string name) => false; public float normalizedTime => 0f; public int fullPathHash => 0; public float length => 0f; }
public class RenderTexture : Texture { public RenderTexture(int w, int h, int depth) { } public RenderTexture(int w, int h, int depth, RenderTextureFormat fmt) { } }
public partial class Sprite : Object { public Rect rect => default; public Texture2D texture => null; }
public partial class Shader : Object { public static Shader Find(string n) => null; }
public partial class Animation : Component, IEnumerable { public bool isPlaying => false; public void Play() { } public void Play(string n) { } public IEnumerator GetEnumerator() { yield break; } }
public class Animator : Component
{
public void SetTrigger(string n) { } public void SetTrigger(int id) { }
public void SetBool(string n, bool v) { } public void SetInteger(string n, int v) { }
public void SetFloat(string n, float v) { }
public bool GetBool(string n) => false; public int GetInteger(string n) => 0; public float GetFloat(string n) => 0f;
public void Play(string n) { } public void Play(int hash) { }
public void Play(string n, int layer) { } public void Play(string n, int layer, float normalizedTime) { }
public void Play(int hash, int layer) { } public void Play(int hash, int layer, float normalizedTime) { }
public void SetLayerWeight(int layer, float w) { }
public float speed { get; set; } public bool enabled { get; set; }
public void ResetTrigger(string n) { } public void ResetTrigger(int id) { }
public void Update(float dt) { }
public void SetTrigger(string n) { } public void Play(string n, int layer, float normalizedTime) { }
public void Play(int hash, int layer, float normalizedTime) { }
public float speed { get; set; } public void Update(float dt) { }
public AnimatorStateInfo GetCurrentAnimatorStateInfo(int layer) => default;
public AnimatorClipInfo[] GetCurrentAnimatorClipInfo(int layer) => new AnimatorClipInfo[0];
}
public class AnimationCurve { public AnimationCurve() { } public AnimationCurve(params Keyframe[] keys) { } public float Evaluate(float t) => 0f; public int length => 0; public Keyframe[] keys { get; set; } public WrapMode preWrapMode { get; set; } public WrapMode postWrapMode { get; set; } public static AnimationCurve Linear(float a, float b, float c, float d) => new AnimationCurve(); }
public class AudioClip : Object { public float length => 0f; }
public partial class AudioSource : Component { public AudioClip clip { get; set; } public float volume { get; set; } public bool isPlaying => false; public bool loop { get; set; } public void Play() { } public void Stop() { } public void Pause() { } }
public partial class AudioSource : Component { public AudioClip clip { get; set; } public float volume { get; set; } }
public partial class Camera : Component
{
public static Camera main => null;
public static Camera current => null;
public static int allCamerasCount => 0;
public static Camera[] allCameras => new Camera[0];
public float nearClipPlane { get; set; }
public float farClipPlane { get; set; }
public float fieldOfView { get; set; }
@@ -443,7 +343,6 @@ namespace UnityEngine
public float aspect { get; set; }
public float depth { get; set; }
public int cullingMask { get; set; }
public int pixelWidth => 1920;
public int pixelHeight => 1080;
public Rect rect { get; set; }
public Rect pixelRect { get; set; }
@@ -454,47 +353,32 @@ namespace UnityEngine
public Vector3 WorldToViewportPoint(Vector3 p) => p;
public Vector3 ScreenToWorldPoint(Vector3 p) => p;
public Vector3 WorldToScreenPoint(Vector3 p) => p;
public Vector3 ViewportToScreenPoint(Vector3 p) => p;
public Vector3 ScreenToViewportPoint(Vector3 p) => p;
public Ray ScreenPointToRay(Vector3 p) => default;
public Ray ViewportPointToRay(Vector3 p) => default;
public void Render() { }
}
public enum CameraClearFlags { Skybox = 1, Color = 2, SolidColor = 2, Depth = 3, Nothing = 4 }
public enum CameraClearFlags { Skybox = 1, Color = 2, Depth = 3}
public partial struct CharacterInfo { }
// ---- coroutine machinery (never pumped headless; types must exist) ----
public class YieldInstruction { }
public sealed class Coroutine : YieldInstruction { }
public sealed class WaitForEndOfFrame : YieldInstruction { }
public sealed class WaitForSeconds : YieldInstruction { public WaitForSeconds(float s) { } }
public sealed class WaitForFixedUpdate : YieldInstruction { }
// ---- input ----
public struct Touch { public int fingerId; public Vector2 position; public TouchPhase phase; public int tapCount; }
// ---- enums (grow members as the compiler demands) ----
public enum FontStyle { Normal, Bold, Italic, BoldAndItalic }
public enum TouchPhase { Began, Moved, Stationary, Ended, Canceled }
public enum FontStyle { Normal}
// KeyCode lives in UnityRuntime.cs (full enum).
[Flags] public enum HideFlags { None = 0, HideInHierarchy = 1, HideInInspector = 2, DontSaveInEditor = 4, NotEditable = 8, DontSaveInBuild = 16, DontUnloadUnusedAsset = 32, DontSave = 52, HideAndDontSave = 61 }
public enum SendMessageOptions { RequireReceiver, DontRequireReceiver }
[Flags] public enum HideFlags { None = 0, NotEditable = 8, DontSave = 52}
public enum SendMessageOptions { DontRequireReceiver }
// ---- attributes: permissive ctors accept any compile-time attribute args ----
public class SerializeField : Attribute { }
public class HideInInspector : Attribute { }
public class ExecuteInEditMode : Attribute { }
public class ExecuteAlwaysAttribute : Attribute { }
public class DisallowMultipleComponentAttribute : Attribute { }
public class AndroidJavaObject : IDisposable { public AndroidJavaObject(string className, params object[] args) { } public T Call<T>(string method, params object[] args) => default; public void Call(string method, params object[] args) { } public T Get<T>(string name) => default; public void Set<T>(string name, T val) { } public void Dispose() { } }
public class WebCamTexture : Texture { public WebCamTexture() { } public WebCamTexture(int w, int h, int fps) { } public WebCamTexture(string deviceName, int w, int h, int fps) { } public void Play() { } public void Stop() { } public bool isPlaying => false; public Color32[] GetPixels32() => new Color32[0]; public static WebCamDevice[] devices => System.Array.Empty<WebCamDevice>(); }
public class AddComponentMenu : Attribute { public AddComponentMenu(string n) { } public AddComponentMenu(string n, int o) { } }
public class ContextMenu : Attribute { public ContextMenu(string n) { } }
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class RequireComponent : Attribute { public RequireComponent(Type a) { } public RequireComponent(Type a, Type b) { } public RequireComponent(Type a, Type b, Type c) { } }
public class HeaderAttribute : Attribute { public HeaderAttribute(string h) { } }
public class TooltipAttribute : Attribute { public TooltipAttribute(string t) { } }
public class SpaceAttribute : Attribute { public SpaceAttribute() { } public SpaceAttribute(float h) { } }
public class RangeAttribute : Attribute { public RangeAttribute(float min, float max) { } }
public class MultilineAttribute : Attribute { public MultilineAttribute() { } public MultilineAttribute(int lines) { } }
@@ -503,41 +387,26 @@ namespace UnityEngine
{
public static bool isEditor => false;
public static bool isPlaying => true;
public static bool isMobilePlatform => false;
public static string persistentDataPath => "";
public static string dataPath => "";
public static string temporaryCachePath => "";
public static string version => "1.0";
public static string identifier => "";
public static int targetFrameRate { get; set; }
public static RuntimePlatform platform => RuntimePlatform.WindowsPlayer;
public static SystemLanguage systemLanguage => SystemLanguage.English;
public static void Quit() { }
public static event System.Action<bool> focusChanged { add { } remove { } }
}
public enum RuntimePlatform { WindowsPlayer, OSXPlayer, IPhonePlayer, Android, WindowsEditor, OSXEditor, LinuxPlayer, XBOX360, BlackBerryPlayer, PS4, XboxOne, Switch, Stadia }
public enum SystemLanguage { English, Japanese, ChineseSimplified, ChineseTraditional, Korean, French, German, Chinese, Unknown }
public enum RuntimePlatform { WindowsPlayer, OSXPlayer, IPhonePlayer, Android, WindowsEditor, OSXEditor, XBOX360, BlackBerryPlayer}
public static partial class Time
{
public static float deltaTime => 0f;
public static float time => 0f;
public static float unscaledTime => 0f;
public static float unscaledDeltaTime => 0f;
public static float fixedDeltaTime => 0.02f;
public static float realtimeSinceStartup => 0f;
public static float timeScale { get; set; }
public static int frameCount => 0;
public static float timeSinceLevelLoad => 0f;
}
public static partial class Screen
{
public static int width => 1920;
public static int height => 1080;
public static float dpi => 96f;
public static ScreenOrientation orientation { get; set; }
public static bool fullScreen { get; set; }
public static Resolution currentResolution => default;
}
public enum ScreenOrientation { Portrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight, AutoRotation }
public struct Resolution { public int width; public int height; public int refreshRate; }
}

View File

@@ -8,8 +8,6 @@ namespace UnityEngine
{
public class TextAsset : Object
{
public string text => "";
public byte[] bytes => new byte[0];
}
public class AsyncOperation
@@ -17,7 +15,6 @@ namespace UnityEngine
public bool isDone => true;
public float progress => 1f;
public int priority { get; set; }
public bool allowSceneActivation { get; set; }
}
public class AssetBundle : Object
@@ -25,27 +22,22 @@ namespace UnityEngine
public static AssetBundle LoadFromFile(string path) => null;
public static AssetBundleCreateRequest LoadFromFileAsync(string path) => null;
public string[] GetAllAssetNames() => new string[0];
public T LoadAsset<T>(string name) where T : Object => null;
public Object LoadAsset(string name) => null;
public Object[] LoadAllAssets() => new Object[0];
public AssetBundleRequest LoadAllAssetsAsync() => null;
public void Unload(bool unloadAllLoadedObjects) { }
}
public class AssetBundleCreateRequest : AsyncOperation { public AssetBundle assetBundle => null; }
public class AssetBundleRequest : AsyncOperation { public Object asset => null; public Object[] allAssets => new Object[0]; }
public class AssetBundleRequest : AsyncOperation { public Object[] allAssets => new Object[0]; }
public class Collider2D : Component { public bool enabled { get; set; } }
public partial class BoxCollider2D : Collider2D { public bool isTrigger { get; set; } public Vector2 offset { get; set; } public Vector2 size { get; set; } }
public partial class BoxCollider2D : Collider2D { public Vector2 offset { get; set; } public Vector2 size { get; set; } }
public partial class Light : Behaviour { }
public class AudioListener : Behaviour { }
public enum RenderTextureFormat { ARGB32, Depth, ARGBHalf, ARGB64, Default }
public enum RenderTextureFormat { ARGB32, Default }
public enum RuntimeInitializeLoadType
{
AfterSceneLoad, BeforeSceneLoad, AfterAssembliesLoaded,
BeforeSplashScreen, SubsystemRegistration
}
public sealed class RuntimeInitializeOnLoadMethodAttribute : Attribute
@@ -56,19 +48,13 @@ namespace UnityEngine
}
// Sub-namespace anchors (referenced via `using`; types unmask in later waves if used).
namespace UnityEngine.Experimental { internal class _ShimAnchor { } }
namespace UnityEngine.Experimental.Rendering { internal class _ShimAnchor { } }
namespace UnityEngine.Experimental { }
namespace UnityEngine.Experimental.Rendering { }
namespace UnityEngine.SceneManagement
{
internal class _ShimAnchor { }
public struct Scene { public string name => ""; public int buildIndex => 0; public bool IsValid() => false; public bool isLoaded => false; }
public static class SceneManager
{
public static void LoadScene(string sceneName) { }
public static void LoadScene(int sceneBuildIndex) { }
public static Scene GetActiveScene() => default;
public static Scene GetSceneByName(string name) => default;
public static int sceneCount => 0;
}
}
namespace UnityEngine.SocialPlatforms
@@ -77,5 +63,4 @@ namespace UnityEngine.SocialPlatforms
// Cute.IAchievementCallback; adding one here makes the unqualified name ambiguous.
public interface IAchievement { }
public interface IAchievementDescription { }
public interface ILocalUser { void Authenticate(System.Action<bool> callback); }
}

View File

@@ -10,7 +10,6 @@ namespace UnityEngine
public partial struct Vector4
{
public static Vector4 zero => default;
public static Vector4 one => new Vector4(1f, 1f, 1f, 1f);
public static Vector4 operator *(Vector4 a, float s) => new Vector4(a.x * s, a.y * s, a.z * s, a.w * s);
public static Vector4 operator *(float s, Vector4 a) => new Vector4(a.x * s, a.y * s, a.z * s, a.w * s);
public static Vector4 operator +(Vector4 a, Vector4 b) => new Vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
@@ -33,7 +32,6 @@ namespace UnityEngine
public bool hasChanged { get; set; }
public Matrix4x4 localToWorldMatrix => default;
public Matrix4x4 worldToLocalMatrix => default;
public void Translate(float x, float y) { }
public void Rotate(float x, float y) { }
public void Translate(Vector3 translation, Space relativeTo) { }
public void Rotate(Vector3 eulers, Space relativeTo) { }
@@ -63,10 +61,6 @@ namespace UnityEngine
public partial class Material
{
public void CopyPropertiesFromMaterial(Material mat) { }
public void SetVectorArray(string name, Vector4[] values) { }
public void SetVectorArray(int nameID, Vector4[] values) { }
public void SetVectorArray(string name, List<Vector4> values) { }
public void SetVectorArray(int nameID, List<Vector4> values) { }
}
public partial class Mesh
@@ -77,15 +71,11 @@ namespace UnityEngine
public Vector2[] uv { get; set; }
public Color32[] colors32 { get; set; }
public void MarkDynamic() { }
public void RecalculateNormals() { }
public void RecalculateTangents() { }
}
public partial class Texture2D
{
public byte[] EncodeToPNG() => Array.Empty<byte>();
public Color32[] GetPixels32() => Array.Empty<Color32>();
public void SetPixels32(Color32[] colors) { }
public bool LoadImage(byte[] data) => false;
}
@@ -99,7 +89,6 @@ namespace UnityEngine
{
public static int PropertyToID(string name) => 0;
public static void SetGlobalColor(string name, Color value) { }
public static void SetGlobalColor(int nameID, Color value) { }
}
public partial class Animation
@@ -115,21 +104,14 @@ namespace UnityEngine
public bool playOnAwake { get; set; }
public int priority { get; set; }
public void PlayOneShot(AudioClip clip) { }
public void PlayOneShot(AudioClip clip, float volumeScale) { }
}
public partial class Camera
{
public bool enabled { get; set; }
public bool allowMSAA { get; set; }
public int eventMask { get; set; }
public TransparencySortMode transparencySortMode { get; set; }
public void ResetAspect() { }
public static int GetAllCameras(Camera[] cameras) => 0;
}
public enum TransparencySortMode { Default, Perspective, Orthographic, CustomAxis }
public partial struct CharacterInfo
{
public int advance;
@@ -144,15 +126,7 @@ namespace UnityEngine
public static event Action<Font> textureRebuilt;
public bool GetCharacterInfo(char ch, out CharacterInfo info, int size, FontStyle style)
{ info = default; return false; }
public bool GetCharacterInfo(char ch, out CharacterInfo info, int size)
{ info = default; return false; }
public bool GetCharacterInfo(char ch, out CharacterInfo info)
{ info = default; return false; }
public void RequestCharactersInTexture(string characters, int size, FontStyle style) { }
public void RequestCharactersInTexture(string characters, int size) { }
public void RequestCharactersInTexture(string characters) { }
// suppress unused-event warning while keeping the API surface
private void _TouchTextureRebuilt() => textureRebuilt?.Invoke(this);
}
public partial class Light
@@ -167,23 +141,18 @@ namespace UnityEngine
public partial class Application
{
public static string streamingAssetsPath => "";
public static NetworkReachability internetReachability => NetworkReachability.NotReachable;
public static void OpenURL(string url) { }
}
public enum NetworkReachability { NotReachable, ReachableViaCarrierDataNetwork, ReachableViaLocalAreaNetwork }
public enum NetworkReachability { NotReachable}
public partial class Screen
{
public static int sleepTimeout { get; set; }
public static void SetResolution(int width, int height, bool fullscreen) { }
public static void SetResolution(int width, int height, FullScreenMode mode) { }
}
public enum FullScreenMode { ExclusiveFullScreen, FullScreenWindow, MaximizedWindow, Windowed }
public enum IMECompositionMode { Auto, On, Off }
public enum IMECompositionMode { Auto, On}
public partial class Input
{
@@ -195,7 +164,6 @@ namespace UnityEngine
public partial class Resources
{
public static Object[] FindObjectsOfTypeAll(Type type) => Array.Empty<Object>();
public static T[] FindObjectsOfTypeAll<T>() => Array.Empty<T>();
}
}
@@ -209,7 +177,6 @@ namespace UnityEngine.Networking
public static UnityWebRequest Get(string uri) => new UnityWebRequest();
public UnityWebRequestAsyncOperation SendWebRequest() => new UnityWebRequestAsyncOperation();
public void SetRequestHeader(string name, string value) { }
public string GetResponseHeader(string name) => null;
public Dictionary<string, string> GetResponseHeaders() => new Dictionary<string, string>();
public bool isDone => true;
public float downloadProgress => 1f;
@@ -224,19 +191,11 @@ namespace UnityEngine.Networking
public class UploadHandlerRaw : UploadHandler { public UploadHandlerRaw(byte[] data) { } }
public class DownloadHandlerBuffer : DownloadHandler { }
public class UnityWebRequestAsyncOperation : AsyncOperation { }
public static class UnityWebRequestTexture { public static UnityWebRequest GetTexture(string uri) => new UnityWebRequest(); }
public class DownloadHandlerTexture : DownloadHandler { public UnityEngine.Texture2D texture => null; public static UnityEngine.Texture2D GetContent(UnityWebRequest www) => null; }
public class DownloadHandlerAssetBundle : DownloadHandler { public UnityEngine.AssetBundle assetBundle => null; public static UnityEngine.AssetBundle GetContent(UnityWebRequest www) => null; }
}
namespace UnityEngine
{
// ---- additional off-battle-path Unity type stubs (CS0246 closure) ----
public sealed class WaitForSecondsRealtime : YieldInstruction { public WaitForSecondsRealtime(float time) { } }
public enum AnimationBlendMode { Blend, Additive }
public class AnimationState { public string name { get; set; } public float speed { get; set; } public float time { get; set; } public float normalizedTime { get; set; } public float length => 0f; public float weight { get; set; } public bool enabled { get; set; } public WrapMode wrapMode { get; set; } public int layer { get; set; } public AnimationBlendMode blendMode { get; set; } public AnimationClip clip => null; }
public class GUIContent { public GUIContent() { } public GUIContent(string text) { } public string text { get; set; } public Texture image { get; set; } }
public class TextEditor { public GUIContent content { get; set; } public string text { get; set; } public void Copy() { } public void Paste() { } public void OnFocus() { } public void SelectAll() { } }
public struct WebCamDevice { public string name => ""; public bool isFrontFacing => false; }
public class Display { public int systemWidth => 0; public int systemHeight => 0; public int renderingWidth => 0; public int renderingHeight => 0; public static Display main => null; public static Display[] displays => Array.Empty<Display>(); }
public class AnimationState { public string name { get; set; } public float speed { get; set; } public float time { get; set; } public float length => 0f; }
}

View File

@@ -6,64 +6,25 @@ using System;
namespace UnityEngine
{
public enum CursorLockMode { None, Locked, Confined }
public static class Gizmos
{
public static Color color { get; set; }
public static void DrawLine(Vector3 from, Vector3 to) { }
}
public static class Physics2D
{
public static RaycastHit2D GetRayIntersection(Ray ray, float distance = Mathf.Infinity) => default;
public static RaycastHit2D GetRayIntersection(Ray ray, float distance, int layerMask) => default;
public static Collider2D OverlapPoint(Vector2 point, int layerMask) => null;
public static Collider2D[] OverlapPointAll(Vector2 point, int layerMask) => Array.Empty<Collider2D>();
}
public static class Caching
{
public static bool ready => true;
public static bool ClearCache() => true;
}
public enum CursorLockMode { None}
public static class GUIUtility { public static string systemCopyBuffer { get; set; } }
public static class Cursor
{
public static CursorLockMode lockState { get; set; }
public static bool visible { get; set; }
}
public static class ColorUtility
{
public static bool TryParseHtmlString(string htmlString, out Color color) { color = default; return false; }
}
public static class ScreenCapture { public static void CaptureScreenshot(string filename) { } }
public static class RenderSettings { public static bool fog { get; set; } }
public static class JsonUtility
{
public static T FromJson<T>(string json) => default!;
public static object FromJson(string json, Type type) => null;
public static string ToJson(object obj) => "";
public static string ToJson(object obj, bool prettyPrint) => "";
public static void FromJsonOverwrite(string json, object objectToOverwrite) { }
}
public static class Social
{
public static UnityEngine.SocialPlatforms.ILocalUser localUser => null;
public static void ReportProgress(string achievementID, double progress, Action<bool> callback) { }
public static void LoadAchievements(Action<UnityEngine.SocialPlatforms.IAchievement[]> callback) { }
public static void LoadAchievementDescriptions(Action<UnityEngine.SocialPlatforms.IAchievementDescription[]> callback) { }
public static void ShowAchievementsUI() { }
}
public static class PlayerPrefs
{
public static void DeleteAll() { }
public static void DeleteKey(string key) { }
public static bool HasKey(string key) => false;
public static void Save() { }
public static float GetFloat(string key, float defaultValue = 0f) => defaultValue;
public static int GetInt(string key, int defaultValue = 0) => defaultValue;
public static string GetString(string key, string defaultValue = "") => defaultValue;
public static void SetFloat(string key, float value) { }
public static void SetInt(string key, int value) { }
public static void SetString(string key, string value) { }
}
@@ -71,8 +32,6 @@ namespace UnityEngine
public static class Physics
{
public static Vector3 gravity { get; set; }
public static bool Raycast(Ray ray, out RaycastHit hit, float maxDistance = float.PositiveInfinity, int layerMask = -1)
{ hit = default; return false; }
public static bool Raycast(Vector3 origin, Vector3 direction, out RaycastHit hit, float maxDistance = float.PositiveInfinity, int layerMask = -1)
{ hit = default; return false; }
public static RaycastHit[] RaycastAll(Ray ray, float maxDistance = float.PositiveInfinity, int layerMask = -1)
@@ -81,35 +40,17 @@ namespace UnityEngine
=> Array.Empty<RaycastHit>();
}
public static class GUI
{
public static Color color { get; set; }
public static void Label(Rect position, string text) { }
}
public static class SystemInfo
{
public static string deviceModel => "";
public static string deviceName => "";
public static string deviceUniqueIdentifier => "";
public static string operatingSystem => "";
public static string graphicsDeviceName => "";
public static string graphicsDeviceVersion => "";
public static int graphicsShaderLevel => 0;
public static int graphicsMemorySize => 0;
public static int systemMemorySize => 0;
public static int processorCount => 1;
public static string processorType => "";
public static bool SupportsRenderTextureFormat(RenderTextureFormat format) => true;
public static bool SupportsTextureFormat(TextureFormat format) => true;
public static bool IsFormatSupported(Experimental.Rendering.GraphicsFormat format, Experimental.Rendering.FormatUsage usage) => true;
}
public static class Graphics
{
public static void Blit(Texture source, RenderTexture dest) { }
public static void Blit(Texture source, RenderTexture dest, Material mat) { }
public static void Blit(Texture source, RenderTexture dest, Material mat, int pass) { }
}
public static class QualitySettings
@@ -123,33 +64,13 @@ namespace UnityEngine
public static string ExtractStackTrace() => "";
}
public enum ColorSpace { Uninitialized = -1, Gamma = 0, Linear = 1 }
public enum RenderTextureReadWrite { Default, Linear, sRGB }
public enum ColorSpace { Linear = 1 }
public enum TextureFormat
{
Alpha8, ARGB4444, RGB24, RGBA32, ARGB32, RGB565, R16, DXT1, DXT5,
RGBA4444, BGRA32, RHalf, RGHalf, RGBAHalf, RFloat, RGFloat, RGBAFloat,
ARGB64, ASTC_6x6, ETC2_RGB, ETC2_RGBA8, ETC_RGB4, PVRTC_RGB4
}
[Flags]
public enum EventModifiers
{
None = 0, Shift = 1, Control = 2, Alt = 4, Command = 8,
Numeric = 16, CapsLock = 32, FunctionKey = 64
}
ARGB32, ASTC_6x6, ETC2_RGB, ETC2_RGBA8 }
}
namespace UnityEngine.Experimental.Rendering
{
public enum GraphicsFormat { None, R8G8B8A8_UNorm, R16G16B16A16_SFloat, R32G32B32A32_SFloat, D32_SFloat }
[Flags]
public enum FormatUsage { Sample = 1, Linear = 2, Sparse = 4, Render = 8, Blend = 16, MSAA2x = 32 }
public static class GraphicsFormatUtility
{
public static GraphicsFormat GetGraphicsFormat(RenderTextureFormat format, RenderTextureReadWrite readWrite) => GraphicsFormat.None;
public static GraphicsFormat GetGraphicsFormat(TextureFormat format, bool isSRGB) => GraphicsFormat.None;
}
}