{"id":440461,"date":"2024-11-30T21:02:57","date_gmt":"2024-11-30T21:02:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=440461"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=440461","title":{"rendered":"<span>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u0432 blueprints \u0438 Unreal Engine<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0430\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 unreal engine, \u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0432\u0438\u0436\u043a\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u043e\u043c, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8dd\/605\/f5f\/8dd605f5f5203a2f9258358150f2bcb8.png\" alt=\"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b\" title=\"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b\" width=\"631\" height=\"402\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8dd\/605\/f5f\/8dd605f5f5203a2f9258358150f2bcb8.png\"\/><\/p>\n<div><figcaption>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u043e, \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438, \u0432\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0435, \u0447\u0442\u043e &#171;\u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f&#187; \u0432 \u0438\u0445 \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0422\u0430\u043a \u043a\u0430\u043a \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0431\u044b\u0442\u044c? \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>UBlueprintAsyncActionBase<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b.<\/p>\n<hr\/>\n<h2>\u0414\u0435\u043b\u0430\u0435\u043c \u0441\u0432\u043e\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u043d\u043e\u0434\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>bool<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0442\u044c execution \u0432\u044b\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 C++ \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <code>UBlueprintAsyncActionBase<\/code>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <code>UAsyncAction<\/code>.<\/p>\n<p>\u041a\u043e\u0434 \u0438\u0437 <code>.h<\/code> \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">\/\/ Fill out your copyright notice in the Description page of Project Settings.  #pragma once  #include \"CoreMinimal.h\" #include \"Kismet\/BlueprintAsyncActionBase.h\" #include \"AsyncAction.generated.h\"  DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnAsyncDone, const bool, WasSuccessful);  \/**  *   *\/ UCLASS() class YOUR_MODULE_API UAsyncAction : public UBlueprintAsyncActionBase {     GENERATED_BODY()  public:     \/\/ \u041d\u0430\u0448 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 execution \u0432\u044b\u0445\u043e\u0434     UPROPERTY(BlueprintAssignable)     FOnAsyncDone OnAsyncDone;      \/\/ \u041f\u0435\u0440\u0432\u0430\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043d\u043e\u0434\u0430     UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly)     static UAsyncAction* FirstAsyncFunction(UObject* Object);      \/\/ \u0412\u0442\u043e\u0440\u0430\u044f \"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f\" \u043d\u043e\u0434\u0430     UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly)     static UAsyncAction* SecondAsyncFunction(const TArray&lt;int32&gt; IntArray);  protected:     virtual void Activate() override;  private:     TWeakObjectPtr&lt;&gt; WeakObject;     TArray&lt;int32&gt; Array;     uint8 bFirstFunction : 1; };<\/code><\/pre>\n<h2>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 2 \u0441\u0442\u0430\u0442\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0430\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441. \u041d\u043e \u0432\u0435\u0434\u044c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>bool<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u044d\u0442\u043e \u043d\u0430\u0448\u0438 &#171;\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b&#187;. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0438\u0445 <code>BlueprintInternalUseOnly<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c, \u0434\u0432\u0438\u0436\u043e\u043a \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u043d\u0430\u0441. \u041d\u0430\u043c \u043b\u0438\u0448\u044c \u043d\u0430\u0434\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u043c\u0443 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b.<\/p>\n<h2>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0430 \u043a\u0430\u043a \u043d\u0430\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 <code>FOnAsyncDone OnAsyncDone<\/code>. \u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0448 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u043e\u043c <strong>\u0434\u043b\u044f \u0432\u0441\u0435\u0445<\/strong> \u043d\u0430\u0448\u0438\u0445 &#171;\u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432&#187;. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0443 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 execution \u0432\u044b\u0445\u043e\u0434 <code>OnAsyncDone<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>WasSuccessful<\/code>.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430\u0448\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0434\u0430\u043b\u0438 \u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434. \u041d\u043e, \u0440\u0430\u0437 \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b, \u0442\u043e \u0433\u0434\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430? \u0423 \u043a\u043b\u0430\u0441\u0441\u0430 <code>UBlueprintAsyncActionBase<\/code> \u0435\u0441\u0442\u044c, \u043f\u043e \u0441\u0443\u0442\u0438, \u043b\u0438\u0448\u044c 1 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2013 <code>Activate()<\/code>. \u041e\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0438\u043c &#171;<code>BeginPlay()<\/code>&#171;. \u0412 \u043d\u0435\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a. <strong>\u0412\u0441\u0435\u0445<\/strong>.<\/p>\n<h2>\u041a\u044d\u0448<\/h2>\n<p>\u0422.\u043a. \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432 <code>Activate()<\/code>, \u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u0442\u0430\u0442\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041a\u043e\u0434 \u0438\u0437 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">\/\/ Fill out your copyright notice in the Description page of Project Settings.   #include \"AsyncAction.h\"  UAsyncAction* UAsyncAction::FirstAsyncFunction(UObject* Object) { const auto Action = NewObject&lt;UAsyncAction&gt;(); Action-&gt;WeakObject = Object; Action-&gt;bFirstFunction = true;  return Action; }  UAsyncAction* UAsyncAction::SecondAsyncFunction(const TArray&lt;int32&gt; IntArray) { const auto Action = NewObject&lt;UAsyncAction&gt;(); Action-&gt;Array = IntArray; Action-&gt;bFirstFunction = false;  return Action; }  void UAsyncAction::Activate() { Super::Activate();  if (bFirstFunction) { AsyncTask(ENamedThreads::AnyBackgroundThreadNormalTask,           [&amp;]           {           FPlatformProcess::Sleep(3.0f);           OnAsyncDone.Broadcast(WeakObject.IsValid());             SetReadyToDestroy();           }); } else {         FPlatformProcess::Sleep(3.0f); OnAsyncDone.Broadcast(Array.Num() &gt; 0); SetReadyToDestroy(); } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0430\u0448\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0420\u0430\u0437 \u0443 \u043d\u0430\u0441 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u0438\u0445 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u043b\u0430\u0433 <code>bFirstFunction<\/code> \u0434\u043b\u044f \u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>SetReadyToDestroy()<\/code>, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c uobject \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c \u043c\u0443\u0441\u043e\u0440\u0430 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<hr\/>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0432\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 3 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c, \u043f\u0443\u0441\u0442\u043e\u0439 \u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ecf\/b81\/3dd\/ecfb813dd36467280e0a24c6724e33c5.png\" alt=\"\u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b\" title=\"\u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b\" width=\"1009\" height=\"664\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ecf\/b81\/3dd\/ecfb813dd36467280e0a24c6724e33c5.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/33a\/312\/5ba\/33a3125ba33a9755be52ea7034959f84.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b\" width=\"115\" height=\"64\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33a\/312\/5ba\/33a3125ba33a9755be52ea7034959f84.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/p>\n<h2>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1b0\/ae7\/4df\/1b0ae74dffa1ff88b48dbdaeae8e1aa3.png\" alt=\"\u0412\u044b\u0437\u043e\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b\" title=\"\u0412\u044b\u0437\u043e\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b\" width=\"1017\" height=\"657\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1b0\/ae7\/4df\/1b0ae74dffa1ff88b48dbdaeae8e1aa3.png\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0437\u043e\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1dc\/eb4\/56c\/1dceb456cf5b0bef2660a2e6036a50ef.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b\" width=\"105\" height=\"56\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1dc\/eb4\/56c\/1dceb456cf5b0bef2660a2e6036a50ef.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, &#171;\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439&#187; \u0432\u044b\u0445\u043e\u0434 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438\u043d\u0442 <code>Function started<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u044f \u0438 \u043f\u043e\u043c\u0435\u0442\u0438\u043b \u0432\u0442\u043e\u0440\u0443\u044e \u043d\u043e\u0434\u0443 \u043a\u0430\u043a \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u0443\u044e(\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043d\u043e\u0434) \u043d\u043e\u0434\u0443, \u0442\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0442\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d\u0430 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430 \u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0443\u043c\u0435\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b \u0432 unreal engine!<\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/862660\/\"> https:\/\/habr.com\/ru\/articles\/862660\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u0430\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 unreal engine, \u0442\u043e \u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0432\u0438\u0436\u043a\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043d\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441, \u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0442\u043e\u043c, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u043e, \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438, \u0432\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0435, \u0447\u0442\u043e &#171;\u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f&#187; \u0432 \u0438\u0445 \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0422\u0430\u043a \u043a\u0430\u043a \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0431\u044b\u0442\u044c? \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>UBlueprintAsyncActionBase<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b.<\/p>\n<hr\/>\n<h2>\u0414\u0435\u043b\u0430\u0435\u043c \u0441\u0432\u043e\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u043d\u043e\u0434\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>bool<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0442\u044c execution \u0432\u044b\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 C++ \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <code>UBlueprintAsyncActionBase<\/code>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e <code>UAsyncAction<\/code>.<\/p>\n<p>\u041a\u043e\u0434 \u0438\u0437 <code>.h<\/code> \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">\/\/ Fill out your copyright notice in the Description page of Project Settings.  #pragma once  #include \"CoreMinimal.h\" #include \"Kismet\/BlueprintAsyncActionBase.h\" #include \"AsyncAction.generated.h\"  DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnAsyncDone, const bool, WasSuccessful);  \/**  *   *\/ UCLASS() class YOUR_MODULE_API UAsyncAction : public UBlueprintAsyncActionBase {     GENERATED_BODY()  public:     \/\/ \u041d\u0430\u0448 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 execution \u0432\u044b\u0445\u043e\u0434     UPROPERTY(BlueprintAssignable)     FOnAsyncDone OnAsyncDone;      \/\/ \u041f\u0435\u0440\u0432\u0430\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043d\u043e\u0434\u0430     UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly)     static UAsyncAction* FirstAsyncFunction(UObject* Object);      \/\/ \u0412\u0442\u043e\u0440\u0430\u044f \"\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f\" \u043d\u043e\u0434\u0430     UFUNCTION(BlueprintCallable, BlueprintInternalUseOnly)     static UAsyncAction* SecondAsyncFunction(const TArray&lt;int32&gt; IntArray);  protected:     virtual void Activate() override;  private:     TWeakObjectPtr&lt;&gt; WeakObject;     TArray&lt;int32&gt; Array;     uint8 bFirstFunction : 1; };<\/code><\/pre>\n<h2>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 2 \u0441\u0442\u0430\u0442\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0430\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043d\u0430\u0448 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441. \u041d\u043e \u0432\u0435\u0434\u044c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>bool<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0412\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u044d\u0442\u043e \u043d\u0430\u0448\u0438 &#171;\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b&#187;. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0438\u0445 <code>BlueprintInternalUseOnly<\/code>. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c, \u0434\u0432\u0438\u0436\u043e\u043a \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u043d\u0430\u0441. \u041d\u0430\u043c \u043b\u0438\u0448\u044c \u043d\u0430\u0434\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u043c\u0443 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b.<\/p>\n<h2>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0425\u043e\u0440\u043e\u0448\u043e, \u0430 \u043a\u0430\u043a \u043d\u0430\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 <code>FOnAsyncDone OnAsyncDone<\/code>. \u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0448 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u043e\u043c <strong>\u0434\u043b\u044f \u0432\u0441\u0435\u0445<\/strong> \u043d\u0430\u0448\u0438\u0445 &#171;\u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432&#187;. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0443 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 execution \u0432\u044b\u0445\u043e\u0434 <code>OnAsyncDone<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0431\u0443\u043b\u0435\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>WasSuccessful<\/code>.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/h2>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430\u0448\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0434\u0430\u043b\u0438 \u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0432\u044b\u0445\u043e\u0434. \u041d\u043e, \u0440\u0430\u0437 \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b, \u0442\u043e \u0433\u0434\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430? \u0423 \u043a\u043b\u0430\u0441\u0441\u0430 <code>UBlueprintAsyncActionBase<\/code> \u0435\u0441\u0442\u044c, \u043f\u043e \u0441\u0443\u0442\u0438, \u043b\u0438\u0448\u044c 1 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2013 <code>Activate()<\/code>. \u041e\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448\u0438\u043c &#171;<code>BeginPlay()<\/code>&#171;. \u0412 \u043d\u0435\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0414\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a. <strong>\u0412\u0441\u0435\u0445<\/strong>.<\/p>\n<h2>\u041a\u044d\u0448<\/h2>\n<p>\u0422.\u043a. \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432 <code>Activate()<\/code>, \u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u0442\u0430\u0442\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041a\u043e\u0434 \u0438\u0437 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">\/\/ Fill out your copyright notice in the Description page of Project Settings.   #include \"AsyncAction.h\"  UAsyncAction* UAsyncAction::FirstAsyncFunction(UObject* Object) { const auto Action = NewObject&lt;UAsyncAction&gt;(); Action-&gt;WeakObject = Object; Action-&gt;bFirstFunction = true;  return Action; }  UAsyncAction* UAsyncAction::SecondAsyncFunction(const TArray&lt;int32&gt; IntArray) { const auto Action = NewObject&lt;UAsyncAction&gt;(); Action-&gt;Array = IntArray; Action-&gt;bFirstFunction = false;  return Action; }  void UAsyncAction::Activate() { Super::Activate();  if (bFirstFunction) { AsyncTask(ENamedThreads::AnyBackgroundThreadNormalTask,           [&amp;]           {           FPlatformProcess::Sleep(3.0f);           OnAsyncDone.Broadcast(WeakObject.IsValid());             SetReadyToDestroy();           }); } else {         FPlatformProcess::Sleep(3.0f); OnAsyncDone.Broadcast(Array.Num() &gt; 0); SetReadyToDestroy(); } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0430\u0448\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0420\u0430\u0437 \u0443 \u043d\u0430\u0441 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u0438\u0445 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u043b\u0430\u0433 <code>bFirstFunction<\/code> \u0434\u043b\u044f \u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>SetReadyToDestroy()<\/code>, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c uobject \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c \u043c\u0443\u0441\u043e\u0440\u0430 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<hr\/>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0432\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 3 \u0441\u0435\u043a\u0443\u043d\u0434\u044b, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c, \u043f\u0443\u0441\u0442\u043e\u0439 \u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0437\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043f\u0435\u0440\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/p>\n<h2>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/h2>\n<figure class=\"full-width\">\n<div><figcaption>\u0412\u044b\u0437\u043e\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, &#171;\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439&#187; \u0432\u044b\u0445\u043e\u0434 \u0432\u0442\u043e\u0440\u043e\u0439 \u043d\u043e\u0434\u044b \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0438\u043d\u0442 <code>Function started<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u044f \u0438 \u043f\u043e\u043c\u0435\u0442\u0438\u043b \u0432\u0442\u043e\u0440\u0443\u044e \u043d\u043e\u0434\u0443 \u043a\u0430\u043a \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445. \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u0443\u044e(\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043d\u043e\u0434) \u043d\u043e\u0434\u0443, \u0442\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0442\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d\u0430 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430 \u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0443\u043c\u0435\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b \u0432 unreal engine!<\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/862660\/\"> https:\/\/habr.com\/ru\/articles\/862660\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-440461","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/440461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=440461"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/440461\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=440461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=440461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=440461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}