MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / from_file

Method from_file

unity_cli/hub/project.py:155–170  ·  view source on GitHub ↗

Parse ProjectSettings/EditorBuildSettings.asset (YAML).

(cls, project_path: Path)

Source from the content-addressed store, hash-verified

153
154 @classmethod
155 def from_file(cls, project_path: Path) -> BuildSettings:
156 """Parse ProjectSettings/EditorBuildSettings.asset (YAML)."""
157 build_file = project_path / "ProjectSettings/EditorBuildSettings.asset"
158
159 if not build_file.exists():
160 return cls(scenes=[])
161
162 content = build_file.read_text(encoding="utf-8")
163 scenes: list[BuildScene] = []
164
165 # Parse scenes using regex (simple YAML parsing)
166 scene_blocks = re.findall(r"-\s+enabled:\s*(\d+)\s+path:\s*([^\s]+)", content)
167 for enabled_str, path in scene_blocks:
168 scenes.append(BuildScene(path=path, enabled=enabled_str == "1"))
169
170 return cls(scenes=scenes)
171
172
173@dataclass(frozen=True)

Callers 7

project_versionFunction · 0.45
project_tagsFunction · 0.45
project_qualityFunction · 0.45
parse_project_versionFunction · 0.45
from_pathMethod · 0.45
open_projectMethod · 0.45

Calls 1

BuildSceneClass · 0.85

Tested by

no test coverage detected