---
name: bootstrap-resource-object
description: "Ensures the existence of a BootstrapRoot in Unity, facilitating initialization and resource management for game development."
---

# Bootstrap Resource Object

## 0. 목적

씬과 무관하게 Devian BootstrapRoot를 DDOL로 보장한다.

---

## 1. 구성

- **DevianBootstrap** (static): BeforeSceneLoad에서 BootstrapRoot prefab 로드/Instantiate + DDOL 보장
- **DevianBootstrapRoot** (MonoBehaviour): BootstrapRoot prefab의 루트 컴포넌트, DevianSettings 참조 보유

---

## 2. Files (SSOT)

- `framework-cs/upm/com.devian.foundation/Runtime/Unity/Bootstrap/DevianBootstrap.cs`
- `framework-cs/upm/com.devian.foundation/Runtime/Unity/Bootstrap/DevianBootstrapRoot.cs`
- `framework-cs/upm/com.devian.foundation/Editor/Settings/DevianSettingsMenu.cs`

---

## 3. 경로 (SSOT)

| 에셋 | 프로젝트 경로 | Resources.Load 경로 |
|------|---------------|---------------------|
| DevianSettings | `Assets/Resources/Devian/DevianSettings.asset` | `Devian/DevianSettings` |
| BootstrapRoot Prefab | `Assets/Resources/Devian/BootstrapRoot.prefab` | `Devian/BootstrapRoot` |

---

## 4. BootstrapRoot 구조

BootstrapRoot는 **registry prefab**이다:
- 여기에 `BootSingleton<T>` 컴포넌트들을 붙여서 자동 등록
- 사용자는 자신의 초기화 MonoBehaviour 스크립트를 붙여서, 원하는 로딩/초기화/등록을 직접 코딩

프레임워크는 "부팅 완료"를 강제/대기하지 않는다. 개발자 코드가 부팅 흐름을 책임진다.

---

## 5. DevianBootstrap

BeforeSceneLoad에서 자동 실행되는 정적 클래스.

```csharp
public static class DevianBootstrap
{
    // BootstrapRoot 존재 보장 + DDOL + Settings 주입
    public static DevianBootstrapRoot Ensure();

    // Settings 캐시 접근
    public static DevianSettings Settings { get; }
}
```

**Ensure() 동작:**
1. 이미 존재하는 DevianBootstrapRoot를 FindAnyObjectByType으로 찾음
2. 없으면 Resources에서 `Devian/BootstrapRoot` prefab 로드 후 Instantiate
3. prefab이 없으면 fallback으로 코드로 생성 (테스트/최소 실행 보장)
4. DontDestroyOnLoad 적용
5. Settings 주입 (없으면 Resources에서 로드)

---

## 6. DevianBootstrapRoot

```csharp
public sealed class DevianBootstrapRoot : MonoBehaviour
{
    [SerializeField] private DevianSettings? _settings;
    public DevianSettings? Settings => _settings;
    public void SetSettings(DevianSettings? settings) { _settings = settings; }
}
```

---

## 7. Editor 메뉴

**메뉴: Devian/Create Bootstrap**

이 메뉴는 다음을 생성/보수한다:
1. DevianSettings (`Assets/Resources/Devian/DevianSettings.asset`)
2. BootstrapRoot Prefab (`Assets/Resources/Devian/BootstrapRoot.prefab`)

**BootstrapRoot Prefab 기본 구성:**
- DevianBootstrapRoot (Settings 참조 연결)
- SceneTransManager

사용자는 BootstrapRoot.prefab에 초기화 스크립트를 추가로 부착해, 원하는 순서/로딩/등록을 직접 코딩할 수 있다.

---

## 8. 테스트 규약

PlayMode 테스트는 SetUp에서 `DevianBootstrap.Ensure()` 호출로 BootstrapRoot 존재를 보장한다.

---

## 9. Reference

- Parent: `skills/devian-unity/30-unity-components/SKILL.md`
- DevianSettings: `skills/devian-unity/30-unity-components/23-devian-settings/SKILL.md`
- SceneTransManager: `skills/devian-unity/30-unity-components/15-scene-trans-manager/SKILL.md`
- Singleton: `skills/devian-unity/30-unity-components/31-singleton/SKILL.md`


---
Source attribution: devwinsoft
Original project: https://github.com/devwinsoft/devian/blob/afdf1cad4bc83c186524901a748408178b634638/skills/devian-unity/30-unity-components/27-bootstrap-resource-object/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 maoshy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: devwinsoft
Original project: https://github.com/devwinsoft/devian/blob/afdf1cad4bc83c186524901a748408178b634638/skills/devian-unity/30-unity-components/27-bootstrap-resource-object/SKILL.md
Attribution basis: Recovered original package and original project license at a pinned revision

Fields of work: Development & Engineering
Roles: Backend Developer, Game Developer
Specialties: Backend
Tools: Unity
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 77dc8a2eb31d4afecff002b5355f497fa620ac55add32e3da18f8108ce0117fe
Metadata reviewed: 2026-10-27
This metadata supersedes earlier Dave AI catalog attribution. Original instruction and supporting files are preserved.
