Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:toolworks:docs:apparatus:detail [2021/06/11 12:55] – created vladius | en:toolworks:docs:apparatus:detail [2022/01/05 13:59] (current) – поправил пункты jispar | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Detail ====== | ====== Detail ====== | ||
- | Details are the main building data blocks in Apparatus. They are high-level entities (unlike Traits), which support some additional ECS+ functionality like multi-iterating and inheritance. | + | Details are the main building data blocks in Apparatus. They are high-level entities (unlike |
- | Details do derive from [[ue> | + | Details do derive from [[ue> |
+ | |||
+ | If you need to change some of the Detail members, you can do it *directly* via members' | ||
+ | |||
+ | As an optimization of some internal logic, Details can't really be removed from Subjectives. They can only be *disabled*. This is effectively the same thing as removal since [[en: | ||
===== Creating Details ===== | ===== Creating Details ===== | ||
Line 11: | Line 15: | ||
In order to create a Detail visible in your C++ source code you have to do the following: | In order to create a Detail visible in your C++ source code you have to do the following: | ||
- | - | + | - Open the main UE File menu and choose the "New C++ Class..." |
+ | - In the opened window mark the "Show All Classes" | ||
+ | - Now you can select any of the base classes available including the Apparatus ones. Choose the Detail as a base class: {{ : | ||
+ | - Click " | ||
+ | - The new class gets created as a combo of its header (.h) and a source file (.cpp). All in the Source (sub)folder of your project. You should now see them in the IDE of your choice:{{ : | ||
+ | - Note that you may have to recompile the project and/or restart the Editor after that. Don't be scared by some possible errors here, regenerate the IDE project, rebuild and start again.{{ : | ||
+ | - The corresponding file contents should be as: | ||
+ | * '' | ||
+ | // Fill out your copyright notice in the Description page of Project Settings. | ||
+ | |||
+ | #pragma once | ||
+ | |||
+ | #include " | ||
+ | #include " | ||
+ | #include " | ||
+ | |||
+ | /** | ||
+ | * | ||
+ | */ | ||
+ | UCLASS() | ||
+ | class MY_API UMyDetail : public UDetail | ||
+ | { | ||
+ | GENERATED_BODY() | ||
+ | |||
+ | }; | ||
+ | </ | ||
+ | * '' | ||
+ | // Fill out your copyright notice in the Description page of Project Settings. | ||
+ | |||
+ | |||
+ | #include " | ||
+ | |||
+ | </ | ||
+ | - Now you can add some data fields to the class as usually, right in the C++ header:< | ||
+ | float X = 0; | ||
+ | float Y = 0; | ||
+ | </ | ||
+ | - Perhaps you would also like to expose those fields as properties in order to access them from BPs and even change their initial values through the UI (for more info, please see [[ue> | ||
+ | UPROPERTY(BlueprintReadWrite, | ||
+ | float X = 0; | ||
+ | UPROPERTY(BlueprintReadWrite, | ||
+ | float Y = 0; | ||
+ | </ | ||
+ | - Your C++-friendly Detail should be ready to use now. Please, refer to [[appi> | ||