C#-Lite Game Engine
CS
Mesin Game C#-Lite
Mesin 2D seperti Unity di peramban Anda
Ready
Game View
FPS0
Time0.0s
Objects0
Frame0
Score0
Statusโธ PAUSED
โถ
Press โถ Play to start
Arrow keys / WASD to move ยท Space to jump
Collect all coins!
Skrip Pemain (C#-Lite)
Edit skrip C# atau C#-Lite Anda, lalu klik Simpan untuk mengompilasi dan menjalankan.
Referensi API 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