// AUTHORED SHIM (not copied). No-op UnityEngine surface for headless battle // resolution. Grows via the M1 compile loop -- add only members the compiler // demands. State-bearing battle logic lives in Engine/; nothing here computes // game state (Unity calls are VFX/IO/rendering, suppressed by IsForecast). using System; using System.Collections; namespace UnityEngine { // ---- value types (Vector2/3, Quaternion, Color, Mathf, Debug live in Primitives.cs) ---- public struct Vector4 { public float x, y, z, w; public Vector4(float x, float y, float z, float w){ this.x=x; this.y=y; this.z=z; this.w=w; } } public struct Color32 { public byte r, g, b, a; public Color32(byte r, byte g, byte b, byte a){ this.r=r; this.g=g; this.b=b; this.a=a; } } public struct Bounds { public Vector3 center, size; public Bounds(Vector3 c, Vector3 s) { center = c; size = s; } 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 { public float x, y, width, height; public Rect(float x, float y, float w, float h) { this.x = x; this.y = y; width = w; height = h; } public float xMin { get => x; set { width += x - value; x = value; } } 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 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 struct Plane { public Plane(Vector3 normal, Vector3 point) { } 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 struct LayerMask { public int value; public static int NameToLayer(string n) => 0; public static implicit operator int(LayerMask m) => m.value; } // ---- core object model ---- public class Object { public string name { get; set; } public HideFlags hideFlags { get; set; } public int GetInstanceID() => 0; public override string ToString() => name ?? base.ToString(); public static void Destroy(Object o) { } public static void Destroy(Object o, float t) { } public static void DestroyImmediate(Object o) { } public static void DontDestroyOnLoad(Object o) { } public static T Instantiate(T original) where T : Object => original; public static T Instantiate(T original, Transform parent) where T : Object => original; public static T Instantiate(T original, Vector3 pos, Quaternion rot) where T : Object => original; public static Object Instantiate(Object original) => original; public static T FindObjectOfType() where T : Object => null; public static T[] FindObjectsOfType() where T : Object => new T[0]; public static Object FindObjectOfType(System.Type t) => null; public static bool operator ==(Object a, Object b) => ReferenceEquals(a, b); public static bool operator !=(Object a, Object b) => !ReferenceEquals(a, b); public static implicit operator bool(Object o) => !ReferenceEquals(o, null); public override bool Equals(object o) => ReferenceEquals(this, o); public override int GetHashCode() => System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(this); } public class Component : Object { public Transform transform => null; public GameObject gameObject => null; public string tag { get; set; } public T GetComponent() => default; public T GetComponent(string type) => default; public Component GetComponent(System.Type t) => null; public Component GetComponent(string t) => null; public T GetComponentInChildren() => default; public T GetComponentInChildren(bool includeInactive) => default; public T[] GetComponentsInChildren() => new T[0]; public T[] GetComponentsInChildren(bool includeInactive) => new T[0]; public T GetComponentInParent() => default; public T[] GetComponentsInParent() => new T[0]; public T[] GetComponents() => 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 bool CompareTag(string t) => false; } public class Behaviour : Component { public bool enabled { get; set; } } public class MonoBehaviour : Behaviour { public Coroutine StartCoroutine(IEnumerator routine) => null; public Coroutine StartCoroutine(string methodName) => null; public void StopCoroutine(IEnumerator routine) { } public void StopCoroutine(Coroutine routine) { } public void StopAllCoroutines() { } public void Invoke(string methodName, float time) { } public void CancelInvoke() { } public bool IsInvoking() => false; } public class Transform : Component, IEnumerable { public Vector3 position { get; set; } public Vector3 localPosition { get; set; } public Vector3 localScale { get; set; } = new Vector3(1, 1, 1); public Vector3 localEulerAngles { get; set; } public Vector3 eulerAngles { get; set; } public Quaternion rotation { get; set; } public Quaternion localRotation { get; set; } public Transform parent { get; set; } public int childCount => 0; public Transform Find(string n) => null; public Transform GetChild(int i) => null; public void SetParent(Transform p) { } public void SetParent(Transform p, bool worldPositionStays) { } 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 InverseTransformPoint(Vector3 p) => p; 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(Vector3 p) { } public void DetachChildren() { } public Transform Find(string n, bool includeInactive) => null; public IEnumerator GetEnumerator() { yield break; } } public class GameObject : Object { public GameObject() { } public GameObject(string name) { this.name = name; } public GameObject(string name, params Type[] components) { this.name = name; } public Transform transform => null; public GameObject gameObject => this; public bool activeSelf => false; public bool activeInHierarchy => false; public int layer { get; set; } public string tag { get; set; } public void SetActive(bool value) { } public T GetComponent() => default; public Component GetComponent(Type t) => null; public Component GetComponent(string t) => null; public T GetComponentInChildren() => default; public T GetComponentInChildren(bool includeInactive) => default; public T[] GetComponentsInChildren() => new T[0]; public T[] GetComponentsInChildren(bool includeInactive) => new T[0]; public T GetComponentInParent() => default; public T[] GetComponents() => new T[0]; public Component[] GetComponents(Type t) => new Component[0]; public T AddComponent() where T : Component => default; public Component AddComponent(Type t) => null; 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 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 { } // ---- rendering / physics / audio (pure no-op presentation) ---- public class Renderer : Component { public Material material { get; set; } public Material[] materials { get; set; } public bool enabled { get; set; } } public class MeshRenderer : Renderer { } public class SkinnedMeshRenderer : Renderer { } public class SpriteRenderer : Renderer { public Sprite sprite { get; set; } } public class MeshFilter : Component { public Mesh mesh { 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 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 struct EmissionModule { public bool enabled; public float rateOverTime; } public struct Particle { public Vector3 position; public Vector3 velocity; public Color32 startColor; public float remainingLifetime; } } public class ParticleSystemRenderer : Renderer { } public class LODGroup : Component { } public class Collider : Component { public bool enabled { get; set; } } public class BoxCollider : Collider { } public class Rigidbody : Component { } public class Rigidbody2D : Component { } public class Material : Object { public Material() { } public Material(Material src) { } public Material(Shader shader) { } public Color color { get; set; } public Shader shader { get; set; } public Texture mainTexture { get; set; } public Vector2 mainTextureOffset { get; set; } 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 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 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 class Texture2D : Texture { public Texture2D(int w, int h) { } public void Apply() { } public Color GetPixel(int x, int y) => Color.white; public void SetPixel(int x, int y, Color c) { } } 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 class Sprite : Object { public Rect rect => default; public Texture2D texture => null; public static Sprite Create(Texture2D t, Rect r, Vector2 pivot) => null; } public 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 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 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 SetLayerWeight(int layer, float w) { } public float speed { get; set; } public bool enabled { get; set; } } public class AnimationCurve { public float Evaluate(float t) => 0f; } public class AudioClip : Object { public float length => 0f; } public 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 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; } public float orthographicSize { get; set; } public bool orthographic { get; set; } 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; } public Color backgroundColor { get; set; } public CameraClearFlags clearFlags { get; set; } public RenderTexture targetTexture { get; set; } public Vector3 ViewportToWorldPoint(Vector3 p) => p; 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 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; } // ---- enums (grow members as the compiler demands) ---- public enum FontStyle { Normal, Bold, Italic, BoldAndItalic } public enum TouchPhase { Began, Moved, Stationary, Ended, Canceled } // 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 } // ---- attributes: permissive ctors accept any compile-time attribute args ---- public class SerializeField : Attribute { } public class HideInInspector : Attribute { } public class ExecuteInEditMode : Attribute { } public class AddComponentMenu : Attribute { public AddComponentMenu(string n) { } public AddComponentMenu(string n, int o) { } } public class ContextMenu : Attribute { public ContextMenu(string n) { } } public class RequireComponent : Attribute { public RequireComponent(Type a) { } public RequireComponent(Type a, Type b) { } } 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) { } } // ---- subsystem singletons / statics ---- public static class Application { 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 focusChanged { add { } remove { } } } public enum RuntimePlatform { WindowsPlayer, OSXPlayer, IPhonePlayer, Android, WindowsEditor, OSXEditor, LinuxPlayer } public enum SystemLanguage { English, Japanese, ChineseSimplified, ChineseTraditional, Korean, French, German, Unknown } public static 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 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; } }