en:toolworks:docs:apparatus:mechanism

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:toolworks:docs:apparatus:mechanism [2021/09/01 19:34] – [C++ Workflow] vladiusen:toolworks:docs:apparatus:mechanism [2021/12/30 20:52] (current) – [C++ Workflow] vladius
Line 1: Line 1:
 ====== Mechanisms ====== ====== Mechanisms ======
  
-Mechanisms are the main parts of the Machine which contain scoped Subject, Subjectives, Chunks and Belts. You enchain the matching Iterables via Mechanisms, so they also actually manage the Chains.+Mechanisms are the main parts of the Machine which contain scoped Subject, Subjectives, Chunks and Belts. You enchain the matching Iterables via Mechanisms, so these also actually manage the Chains.
  
 Each UE World, that has any Apparatus-specific entities is accompanied by a Mechanism automatically, you don't have to worry about that. Each UE World, that has any Apparatus-specific entities is accompanied by a Mechanism automatically, you don't have to worry about that.
Line 12: Line 12:
  
 To obtain a Mechanism for a World one would call [[appi>class_u_machine.html#aa3bd4fc507ecf923c812c7fc2aaf7331|API]] like:<code cpp> To obtain a Mechanism for a World one would call [[appi>class_u_machine.html#aa3bd4fc507ecf923c812c7fc2aaf7331|API]] like:<code cpp>
-UMechanism* Mechanism = UMachine::ObtainMechanism(GetWorld());+AMechanism* Mechanism = UMachine::ObtainMechanism(GetWorld());
 </code> </code>
  
Line 18: Line 18:
 FSubjectHandle Subject = Mechanism->SpawnSubject(); FSubjectHandle Subject = Mechanism->SpawnSubject();
 </code> </code>
 +
 +Creating your separate (possibly transient) Mechanisms is also supported and can be handy. You instantiate the Mechanism like you would any other ''UObject'' (''[[ue>API/Runtime/CoreUObject/UObject/NewObject|NewObject<UMechanism>(...)]]''):<code cpp>
 +AMechanism* Mechanism = NewObject<AMechanism>(GetTransientPackage());
 +</code>
 +
 +Please, see the corresponding [[appi>class_u_mechanism.html|API reference]] for more details.
 +
  • en/toolworks/docs/apparatus/mechanism.1630514069.txt.gz
  • Last modified: 2021/09/01 19:34
  • by vladius