C#-Lite Game Engine
CS
محرك ألعاب C#-Lite
محرك ثنائي الأبعاد يشبه Unity في متصفحك
Ready
Game View
FPS0
Time0.0s
Objects0
Frame0
Score0
Status⏸ PAUSED
Arrow keys / WASD to move · Space to jump
Collect all coins!
نص اللاعب (C#-Lite)
قم بتحرير نص C# أو C#-Lite الخاص بك، ثم انقر فوق حفظ للترجمة والتشغيل.
مرجع واجهة برمجة تطبيقات C#-Lite
Lifecycle Methods
Awake() — Called when component is created
Start() — Called before first Update
Update() — Called every frame
FixedUpdate() — Called every physics step
LateUpdate() — Called after all Updates
OnCollision(other) — Collision callback
OnTriggerEnter(other) — Trigger callback
OnDestroy() — Called when destroyed
Input
Input.GetKey(key) — Key held
Input.GetKeyDown(key) — Key just pressed
Input.GetKeyUp(key) — Key just released
Input.GetAxisRaw(axis) — Axis value (-1, 0, 1)
Input.GetAxis(axis) — Same as GetAxisRaw
Input.mousePosition — Mouse pos
Components
Transform — position, rotation, scale
Rigidbody2D — velocity, gravity, mass
BoxCollider2D — width, height, isTrigger
CircleCollider2D — radius, isTrigger
SpriteRenderer — color, width, height, shape
Component — base for all scripts
Game Object
Game.createGameObject(name)
Game.Destroy(obj)
Game.Instantiate(obj)
Game.Find(name)
Game.FindWithTag(tag)
Game.FindAll(tag)
Math Utilities
Mathf.Clamp(v, min, max)
Mathf.Lerp(a, b, t)
Mathf.Abs / Min / Max / Sign
Mathf.Sin / Cos / Atan2
Mathf.Round / Floor / Ceil
Mathf.PI / Deg2Rad / Rad2Deg
Time & Colors
Time.deltaTime — Frame delta
Time.time — Total elapsed
Time.frameCount
Color.red / green / blue / white
Color(r, g, b, a)
Vector2(x, y)
Supported C# Patterns (Converter)
What works:
- ✅ Classes extending MonoBehaviour
- ✅ void / float / int / bool / string types
- ✅ if / else / for / while / return
- ✅ Debug.Log → print()
- ✅ Destroy() → Game.Destroy()
- ✅ Instantiate() → Game.Instantiate()
- ✅ GetComponent() → GetComponent(T)
- ✅ Input.GetKeyDown(KeyCode.X)
- ✅ Mathf methods
- ✅ Random.Range → Math.random
- ✅ List/Dictionary → []/{}
- ✅ foreach → for..of
Limitations:
- ⚠️ Regex-based (not a full parser)
- ⚠️ Complex nested logic may need cleanup
- ⚠️ No LINQ, async/await, generics
- ⚠️ No .NET framework library support
- ⚠️ Multi-line expressions need manual fixing
- ⚠️ Advanced Unity APIs not covered
- ⚠️ Coroutines not supported
- ⚠️ Enums, interfaces, structs not supported