ramyaa1113 commited on
Commit
050de2f
Β·
1 Parent(s): d00747b

final UI polish

Browse files
Files changed (2) hide show
  1. README.md +43 -1
  2. app.py +2 -2
README.md CHANGED
@@ -10,5 +10,47 @@ pinned: false
10
  ---
11
  # Unity β†’ Unreal Code Translator
12
 
13
- This Space converts **Unity C# code** into **Unreal C++ and Blueprint pseudo-code**, using an LLM backend with structured translation prompts.
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
  # Unity β†’ Unreal Code Translator
12
 
13
+ # Overview
14
 
15
+ **Unity β†’ Unreal Code Translator** is an AI-assisted developer tool that automatically converts Unity C# scripts into Unreal Engine-ready C++ and Blueprint Python scripts.
16
+ It's designed to help developers migrate gameplay logic, components, and class structures from Unity to Unreal with minimal manual rewriting.
17
+
18
+ Powered by large language models (Hugging Face or OpenAI), it understands Unity's MonoBehaviour patterns and maps them to equivalent Unreal constructs such as AActor, UCLASS, UPROPERTY, and UFUNCTION.
19
+
20
+ # Key Features
21
+
22
+ **Automatic Code Translation** – Converts Unity C# code to Unreal C++ header/source files and Blueprint Python scripts.
23
+
24
+ **Smart Mapping Rules** – Uses a customizable mapping_table.json to define how Unity APIs map to Unreal equivalents.
25
+
26
+ **Header & Source Separation** – Outputs clean, compile-ready .h and .cpp files using Unreal coding conventions.
27
+
28
+ **Blueprint Generation** – Creates Unreal Python scripts that can build Blueprint actors directly in Unreal Editor.
29
+
30
+ **Downloadable Files** – Exports .h and .cpp files automatically named after your Unity class (e.g., PlayerController.h).
31
+
32
+ **Backend Flexibility** – Choose between Hugging Face (Mistral) or OpenAI (GPT-4o-mini) model backends.
33
+
34
+ **Interactive UI** – Simple, responsive Gradio interface with separate tabs for C++ and Blueprint outputs.
35
+
36
+ # Tech Stack
37
+
38
+ **Frontend**: Gradio (for interactive UI)
39
+
40
+ **Backend**: Python (Fast LLM inference + file generation)
41
+
42
+ **LLM Models**: Hugging Face Mistral-7B-Instruct-v0.3 / OpenAI gpt-4o-mini
43
+
44
+ **Mapping Logic**: JSON-based Unity to Unreal API mapping
45
+
46
+ **File Outputs**: Unreal-style .h, .cpp, and Python script files
47
+
48
+ # How It Works
49
+
50
+ **Parse**: The Unity C# code is analyzed to extract class names, variables, and functions.
51
+
52
+ **Map**: Each Unity API call or type is matched with Unreal equivalents using mapping_table.json.
53
+
54
+ **Synthesize**: A large language model generates the Unreal C++ and Blueprint Python versions.
55
+
56
+ **Split & Save**: The generated output is divided into .h and .cpp sections and made downloadable.
app.py CHANGED
@@ -6,7 +6,7 @@ import re
6
  agent = TranslationAgent()
7
 
8
  title = "Unity β†’ Unreal Code Translator"
9
- description = "Paste a Unity C# script and get Unreal C++ (.h/.cpp) + Unreal Blueprint Python generator."
10
 
11
 
12
  def extract_class_name(csharp_code: str) -> str:
@@ -67,7 +67,7 @@ def do_translate(csharp_code, target_format, model_choice):
67
 
68
  # Gradio UI
69
  with gr.Blocks(title=title) as demo:
70
- gr.Markdown(f"### 🧠 {title}")
71
  gr.Markdown(description)
72
 
73
  with gr.Row():
 
6
  agent = TranslationAgent()
7
 
8
  title = "Unity β†’ Unreal Code Translator"
9
+ description = "AI-assisted developer tool that automatically converts Unity C# scripts into Unreal Engine-ready C++ and Blueprint Python scripts. It's designed to help developers migrate gameplay logic, components, and class structures from Unity to Unreal with minimal manual rewriting. Powered by large language models Hugging Face Mistral and OpenAI"
10
 
11
 
12
  def extract_class_name(csharp_code: str) -> str:
 
67
 
68
  # Gradio UI
69
  with gr.Blocks(title=title) as demo:
70
+ gr.Markdown(f"### {title}")
71
  gr.Markdown(description)
72
 
73
  with gr.Row():