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

@@ -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; }
}