Convert to dictionary for JSON output.
(self)
| 240 | ) |
| 241 | |
| 242 | def to_dict(self) -> dict[str, Any]: |
| 243 | """Convert to dictionary for JSON output.""" |
| 244 | return { |
| 245 | "path": str(self.path), |
| 246 | "unity_version": self.unity_version.version, |
| 247 | "unity_revision": self.unity_version.revision, |
| 248 | "product_name": self.settings.product_name, |
| 249 | "company_name": self.settings.company_name, |
| 250 | "version": self.settings.version, |
| 251 | "screen_size": { |
| 252 | "width": self.settings.default_screen_width, |
| 253 | "height": self.settings.default_screen_height, |
| 254 | }, |
| 255 | "build_scenes": [{"path": s.path, "enabled": s.enabled} for s in self.build_settings.scenes], |
| 256 | "packages": [ |
| 257 | {"name": p.name, "version": p.version, "local": p.is_local} for p in self.packages.dependencies |
| 258 | ], |
| 259 | } |
| 260 | |
| 261 | |
| 262 | # ============================================================================= |