Skip to content

Commit b49aa50

Browse files
committed
feat: added ecsact unreal codegen section
1 parent 0fd8eac commit b49aa50

File tree

7 files changed

+76
-3
lines changed

7 files changed

+76
-3
lines changed

src/app/start/start.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
<a routerLink="/start/cli" routerLinkActive="active">Overview</a>
4545
</ecsact-sidenav-section>
4646
<ecsact-sidenav-section title="Unreal Engine">
47-
<a routerLink="/start/unreal" routerLinkActive="active">Setup</a>
47+
<a routerLink="/start/unreal" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">Setup</a>
48+
<a routerLink="/start/unreal/codegen" routerLinkActive="active">Codegen</a>
4849
</ecsact-sidenav-section>
4950
<ecsact-sidenav-section title="Godot">
5051
<a routerLink="/start/godot" routerLinkActive="active"

src/app/start/unreal/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ng_project(
1010
"start-unreal-routing.module.ts",
1111
],
1212
deps = [
13+
"//src/app/start/unreal/codegen",
1314
"//:node_modules/@angular/common",
1415
"//:node_modules/@angular/core",
1516
"//:node_modules/@angular/router",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
load("//tools:ng.bzl", "ng_project")
2+
3+
package(default_visibility = ["//:__subpackages__"])
4+
5+
ng_project(
6+
name = "codegen",
7+
srcs = [
8+
"unreal-codegen.component.html",
9+
"unreal-codegen.component.ts",
10+
],
11+
deps = [
12+
"//:node_modules/@angular/common",
13+
"//:node_modules/@angular/core",
14+
"//:node_modules/@angular/router",
15+
"//src/components/code-block-variation",
16+
"//src/components/prism",
17+
],
18+
)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<article>
2+
<h1>Ecsact -> Unreal C++</h1>
3+
<p>A large part of what makes Ecsact work is code generation and with Unreal projects its no exception. The Ecsact Unreal plugin is not only an Unreal plugin, but an Ecsact Codegen plugin as well!</p>
4+
<h2 id="whats-generated">What's Generated?</h2>
5+
<p>
6+
The goal of the codegen plugin is to remove a lot of boilerplate code that would otherwise be tedious to write. By default the Ecsact Unreal codegen plugin generates the following:
7+
</p>
8+
<ul>
9+
<li><a href="https://dev.epicgames.com/documentation/en-us/unreal-engine/structs-in-unreal-engine" _target="_blank"><span class="i24">open_in_new</span> <code>UStructs</code></a> for every component in your Ecsact file</li>
10+
<li><a href="https://dev.epicgames.com/documentation/en-us/unreal-engine/overview-of-mass-entity-in-unreal-engine" _target="blank"><span class="i24">open_in_new</span> Unreal Mass Entity</a> Fragments or Tags for every component in your Ecsact file</li>
11+
<li>Ecsact Runner Subsystem with easily overridable component events</li>
12+
<li>Ecsact Runner Subsystem for Ecsact to Entity Mass communication</li>
13+
</ul>
14+
15+
<h2 id="setup-codegen">Setup Codegen</h2>
16+
<p>
17+
We recommend using the <code>EcsactUnrealCodegen</code> command line tool that comes with the <a routerLink="/start">Ecsact SDK</a> since <code>0.9.0</code>. Simply execute <code>EcsactUnrealCodegen</code> for your project and the tool will search for all <code>.ecsact</code> files in your <code>Source</code> directory and use the Ecsact codegen tool with the Ecsat Unreal codegen plugin. The Ecsact Unreal plugin is required to be installed for the tool to find the right codegen plugin. If you run into issues please see the output of <code>EcsactUnrealCodegen</code> for details.</p>
18+
<h3 id="run-codegen-command-line">Command Line or Script</h3>
19+
<p>Replace <code>path/to/project.uproject</code> with the path to your unreal project file and <code>path/to/unreal/install</code> with the full path to your Unreal Engine installation directory</p>
20+
<pre><code prism language="bash">
21+
EcsactUnrealCodegen path/to/project.uproject --engine-dir path/to/unreal/install
22+
</code></pre>
23+
<h3 id="run-codegen-prebuildstep">As a PreBuildStep (recommended)</h3>
24+
<pre><code prism language="javascript">
25+
"PreBuildSteps": {{'{'}}
26+
"Win64": [
27+
"EcsactUnrealCodegen $(ProjectDir) --engine-dir $(EngineDir) --format || exit /b 1"
28+
]
29+
{{'}'}}
30+
</code></pre>
31+
</article>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {Component, OnInit, ChangeDetectionStrategy} from '@angular/core';
2+
import {RouterLink} from '@angular/router';
3+
import {PrismComponent} from '../../../../components/prism/prism.component';
4+
5+
@Component({
6+
templateUrl: './unreal-codegen.component.html',
7+
changeDetection: ChangeDetectionStrategy.OnPush,
8+
standalone: true,
9+
imports: [RouterLink, PrismComponent],
10+
})
11+
export class UnrealCodegenComponent implements OnInit {
12+
constructor() {}
13+
14+
ngOnInit(): void {}
15+
}

src/app/start/unreal/start-unreal-routing.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ const routes: Routes = [
88
loadComponent: () =>
99
import('./start-unreal.component').then(m => m.StartUnrealComponent),
1010
},
11+
{
12+
path: 'codegen',
13+
pathMatch: 'full',
14+
loadComponent: () =>
15+
import('./codegen/unreal-codegen.component').then(
16+
m => m.UnrealCodegenComponent,
17+
),
18+
},
1119
];
1220

1321
@NgModule({

src/app/start/unreal/start-unreal.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@ <h2 id="ecsact-unreal-plugin-features">Ecsact Unreal Plugin Features</h2>
5151
<a
5252
class="aspect-video rounded-lg shadow-lg border border-transparent hover:border-secondary transition-colors bg-content-bg py-4 px-8"
5353
routerLink="/start/unreal/runtime">
54-
<div>Ecsact Unreal Codegen</div>
54+
<div>Ecsact Runtime</div>
5555
<div>TODO</div>
5656
</a>
5757
<a
5858
class="aspect-video rounded-lg shadow-lg border border-transparent hover:border-secondary transition-colors bg-content-bg py-4 px-8"
5959
routerLink="/start/unreal/codegen">
6060
<div>Ecsact Unreal Codegen</div>
61-
<div>TODO</div>
6261
</a>
6362
<a
6463
class="aspect-video rounded-lg shadow-lg border border-transparent hover:border-secondary transition-colors bg-content-bg py-4 px-8"

0 commit comments

Comments
 (0)