AI/Etc

Unity 개발 생산성 300% ν–₯상! AI μ½”λ”© μ–΄μ‹œμŠ€ν„΄νŠΈμš© ν•„μˆ˜ μŠ€ν‚¬ λͺ¨μŒ!

blacknabis 2026. 2. 7. 18:19

μ œλ―Έλ‚˜μ΄λ‘œ 검색해보고 μΈν„°λ„·μ—μ„œ 찾아보닀가 μš”μ¦˜ μžλ™ν™”λ₯Ό κ³΅λΆ€ν•˜κ³  μžˆλŠ”λ° μ΅œλŒ€ν•œ λ”ΈμΉ΅λͺ¨λ“œ! 온!

πŸ€– Unity 개발 생산성 300% ν–₯상! AI μ½”λ”© μ–΄μ‹œμŠ€ν„΄νŠΈμš© ν•„μˆ˜ μŠ€ν‚¬ λͺ¨μŒ

졜근 AI μ½”λ”© μ–΄μ‹œμŠ€ν„΄νŠΈ(Cursor, Windsurf λ“±)κ°€ 개발자의 ν•„μˆ˜ 도ꡬ가 λ˜μ—ˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ AIμ—κ²Œ 맀번 λ˜‘κ°™μ€ μ»¨ν…μŠ€νŠΈλ₯Ό μ„€λͺ…ν•˜κ±°λ‚˜ μŠ€νƒ€μΌμ„ κ΅μ •ν•΄μ£ΌλŠ” 것은 번거둜운 μΌμž…λ‹ˆλ‹€.

이 κΈ€μ—μ„œλŠ” AIκ°€ 'μ „λ¬Έκ°€ λͺ¨λ“œ'둜 λ™μž‘ν•˜λ„λ‘ λ§Œλ“œλŠ” 4κ°€μ§€ 핡심 μŠ€ν‚¬(System Instructions)을 κ³΅μœ ν•©λ‹ˆλ‹€. 이 ν”„λ‘¬ν”„νŠΈ(μŠ€ν‚¬)λ₯Ό AI μ„€μ •μ΄λ‚˜ ν”„λ‘œμ νŠΈ λ£°(/rules, .cursorrules λ“±)에 등둝해 두면, 초보적인 μ‹€μˆ˜λ₯Ό 쀄이고 μ‹œλ‹ˆμ–΄ 개발자 μˆ˜μ€€μ˜ μ½”λ“œλ₯Ό λ°”λ‘œ 생성할 수 μžˆμŠ΅λ‹ˆλ‹€.


πŸ› οΈ 1. 에디터 μžλ™ν™” μ „λ¬Έκ°€ (Unity Editor Automation)

반볡적인 μž‘μ—…μ„ 쀄이기 μœ„ν•΄ μ»€μŠ€ν…€ 에디터 νˆ΄μ„ λ§Œλ“€ λ•Œ μœ μš©ν•©λ‹ˆλ‹€. 초보 AIκ°€ 자주 μ‹€μˆ˜ν•˜λŠ” Undo λ“±λ‘μ΄λ‚˜ 에셋 μ €μž₯ μ²˜λ¦¬κΉŒμ§€ μ™„λ²½ν•˜κ²Œ κ°€μ΄λ“œν•©λ‹ˆλ‹€.

πŸ“Œ 핡심 포인트

  • Undo κΈ°λŠ₯ κ°•μ œ: μ‹€μˆ˜λ‘œ 데이터λ₯Ό λ‚ λ¦¬λŠ” 것을 λ°©μ§€.
  • AssetDatabase 무결성: λŒ€λŸ‰ μˆ˜μ • μ‹œ μ•ˆμ „ν•œ νŠΈλžœμž­μ…˜ 처리.

πŸ“œ μŠ€ν‚¬ λ‚΄μš© (λ³΅μ‚¬ν•΄μ„œ μ‚¬μš©ν•˜μ„Έμš”)

# Unity Editor Automation Expert

This skill provides specialized knowledge and best practices for extending the Unity Editor. Use this skill whenever you need to create custom tools, automate repetitive tasks, or modify the editor interface.

## Core Principles

1.  **Safety First**: Always implement `Undo` functionality.
    *   Use `Undo.RecordObject(target, "Action Name")` before modifying serialized properties.
    *   Use `Undo.RegisterCreatedObjectUndo(obj, "Create Object")` when instantiating new objects.
    *   Use `Undo.DestroyObjectImmediate(obj)` instead of `Object.DestroyImmediate`.

2.  **Asset Database Integrity**:
    *   Always call `AssetDatabase.SaveAssets()` and `AssetDatabase.Refresh()` after batch operations.
    *   Use `AssetDatabase.StartAssetEditing()` and `AssetDatabase.StopAssetEditing()` for bulk changes to improve performance.

## Common Code Snippet: Menu Item

```csharp
using UnityEditor;
using UnityEngine;

public class MyTools
{
    [MenuItem("Tools/My Custom Tool")]
    public static void RunTool()
    {
        // Tool logic here
        Debug.Log("Tool executed!");
    }
}
---

## πŸš€ 2. μ„±λŠ₯ μ΅œμ ν™” λ§ˆμŠ€ν„° (Unity Performance Audit)

AIκ°€ μ§  μ½”λ“œλŠ” λŒμ•„λŠ” κ°€μ§€λ§Œ μ„±λŠ₯이 엉망인 κ²½μš°κ°€ λ§ŽμŠ΅λ‹ˆλ‹€. 이 μŠ€ν‚¬μ€ κ°€λΉ„μ§€ μ»¬λ ‰μ…˜(GC) 폭탄을 ν”Όν•˜κ³  ν”„λ ˆμž„ λ“œλžμ„ λ§‰λŠ” μ΅œμ ν™” μ½”λ“œλ₯Ό μž‘μ„±ν•˜κ²Œ ν•©λ‹ˆλ‹€.

### πŸ“Œ 핡심 포인트
*   **캐싱 ν•„μˆ˜**: `Update()` λ¬Έ μ•ˆμ˜ `GetComponent` κΈˆμ§€.
*   **λ¬Έμžμ—΄ μ—°μ‚° μ΅œμ†Œν™”**: GC λ°œμƒ μ–΅μ œ.
*   **였브젝트 풀링**: λΆˆν•„μš”ν•œ 생성/파괴 λ°©μ§€.

### πŸ“œ μŠ€ν‚¬ λ‚΄μš© (λ³΅μ‚¬ν•΄μ„œ μ‚¬μš©ν•˜μ„Έμš”)

```markdown
# Unity Performance Optimization Expert

This skill focuses on writing high-performance C# code for Unity and identifying common pitfalls that cause frame drops or garbage collection spikes.

## Golden Rules for Optimization

1.  **Cache Components**:
    *   **Bad**: Calling `GetComponent<T>()` in `Update()`.
    *   **Good**: Cache in `Awake()` or `Start()`.

2.  **Avoid String Concatenation**:
    *   **Bad**: `text.text = "Score: " + score;` (Creates garbage every frame)
    *   **Good**: use `StringBuilder` or verify if the value actually changed before updating.

3.  **Use CompareTag**:
    *   **Bad**: `if (gameObject.tag == "Player")`
    *   **Good**: `if (gameObject.CompareTag("Player"))` (Avoids string allocation).

4.  **Object Pooling**:
    *   Never `Instantiate` or `Destroy` frequently (e.g., bullets, effects) during gameplay.
    *   Use a Pool Manager to reuse objects.

🎨 3. λͺ¨λ˜ UI μ•„ν‚€ν…νŠΈ (Unity Modern UI)

μ§€μ €λΆ„ν•œ UI μ½”λ“œλŠ” 이제 그만! MVP/MVVM νŒ¨ν„΄μ„ μ μš©ν•˜κ³  DOTween을 ν™œμš©ν•œ μ„Έλ ¨λœ μ—°μΆœ μ½”λ“œλ₯Ό μž‘μ„±ν•˜λ„λ‘ κ°€μ΄λ“œν•©λ‹ˆλ‹€.

πŸ“Œ 핡심 포인트

  • 둜직과 뷰의 뢄리: μœ μ§€λ³΄μˆ˜κ°€ μ‰¬μš΄ ꡬ쑰.
  • DOTween 톡합: ν•˜λ“œμ½”λ”©λœ μ• λ‹ˆλ©”μ΄μ…˜ λŒ€μ‹  λΆ€λ“œλŸ¬μš΄ 트윈 μ—°μΆœ μ‚¬μš©.
  • Canvas μ΅œμ ν™”: μ„±λŠ₯을 κ³ λ €ν•œ 계측 ꡬ쑰 μ œμ•ˆ.

πŸ“œ μŠ€ν‚¬ λ‚΄μš© (λ³΅μ‚¬ν•΄μ„œ μ‚¬μš©ν•˜μ„Έμš”)

# Unity Modern UI Expert

This skill guides the creation of clean, maintainable, and visually appealing UI in Unity, focusing on the separation of concerns and modern animation techniques.

## UI Architecture Patterns

### MVP (Model-View-Presenter)
*   **Model**: Data (pure C#, ScriptableObjects).
*   **View**: MonoBehaviour referencing UI components (Text, Image). logic: None, just display.
*   **Presenter**: Glue code. Listens to Model changes -> updates View. Listens to View input -> updates Model.

## Styling & Animation

1.  **DOTween Integration**:
    *   Use DOTween for programmatic animation (fade, scale, move).
    *   Always manage tween lifecycles (kill tweens on destroy).
    *   Example: `rectTransform.DOAnchorPos(targetPos, 0.5f).SetEase(Ease.OutBack);`

πŸ–ŒοΈ 4. AI 에셋 생성 μ›Œν¬ν”Œλ‘œ (ComfyUI for Game Dev)

개발 쀑 ν•„μš”ν•œ λ¦¬μ†ŒμŠ€(μ•„μ΄μ½˜, ν…μŠ€μ²˜)λ₯Ό ComfyUIλ₯Ό 톡해 μƒμ„±ν•˜κ³ , μœ λ‹ˆν‹°μ™€ μ—°λ™ν•˜λŠ” λ…Έν•˜μš°μž…λ‹ˆλ‹€.

πŸ“Œ 핡심 포인트

  • ν•„μˆ˜ λ…Έλ“œ μΆ”μ²œ: μ‹¬λ¦¬μŠ€(Seamless) ν…μŠ€μ²˜, μΌκ΄€λœ 캐릭터 생성을 μœ„ν•œ IPAdapter.
  • μœ λ‹ˆν‹° 연동: API λͺ¨λ“œλ₯Ό 톡해 μœ λ‹ˆν‹° μ—λ””ν„°μ—μ„œ λ°”λ‘œ 이미지 생성 μš”μ²­.

πŸ“œ μŠ€ν‚¬ λ‚΄μš© (λ³΅μ‚¬ν•΄μ„œ μ‚¬μš©ν•˜μ„Έμš”)

# ComfyUI for Game Development

This skill provides expertise in using ComfyUI to generate game assets (textures, icons, sprites) and integrating AI generation directly into Unity.

## Essential Custom Nodes
1.  **ComfyUI-Seamless-Tiling**: Mandatory for generating tileable environment textures.
2.  **IPAdapter**: Essential for consistent character style transfer.
3.  **ControlNet**: Creating assets that match specific shapes or poses.

## Unity Integration Code (Simple Bridge)

```csharp
// Simple UnityWebRequest to ComfyUI API
IEnumerator PostRequest(string prompt)
{
    string json = $"{{\"prompt\": {{ ... \"text\": \"{prompt}\" ... }} }}";
    var request = new UnityWebRequest("http://127.0.0.1:8188/prompt", "POST");
    // ... setup and send ...
}
---

## 🎯 마무리

이 μŠ€ν‚¬ νŒŒμΌλ“€μ„ μ—¬λŸ¬λΆ„μ˜ AI μ–΄μ‹œμŠ€ν„΄νŠΈ 섀정에 μΆ”κ°€ν•΄ λ³΄μ„Έμš”. λ‹¨μˆœν•œ μ½”λ”© κΈ°κ³„μ˜€λ˜ AIκ°€ **μœ λ‹ˆν‹° μ „λ¬Έ μ‹œλ‹ˆμ–΄ νŒŒνŠΈλ„ˆ**둜 λ³€μ‹ ν•  κ²ƒμž…λ‹ˆλ‹€!
λ°˜μ‘ν˜•