ユーザ用ツール

サイト用ツール

wiki:ue4:tips:501

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
wiki:ue4:tips:501 [2015/03/28 09:52]
step
— (現在)
ライン 1: ライン 1:
-====== C++/​コンポーネントの追加(4.7.3) ====== 
  
-  - 「詳細パネル」の「新規コンポーネントの追加」から「新規C++コンポーネントの追加…」を選択する。 
-  - 「ActorComponent」を選択して次へ進む。 
-  - 「MyActorComponent」など名前を付けて「クラスを作成」する。 
- 
- 
-<code csharp> 
-// MyActorComponent.h ​ 
-class STDPROJECT_API UMyActorComponent : public UActorComponent 
-{ 
-    GENERATED_BODY() 
- 
-private: 
-    // 追加 
-    float m_fRunningTime;​ 
-} 
-</​code>​ 
- 
-<code csharp> 
- 
-// 開始時に呼ばれる 
-void UMyActorComponent::​InitializeComponent() 
-{ 
-    Super::​InitializeComponent();​ 
-} 
- 
- 
-// 毎フレーム呼ばれる 
-void UMyActorComponent::​TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) 
-{ 
-    Super::​TickComponent( DeltaTime, TickType, ThisTickFunction ); 
- 
-    // 追加 
-    AActor* pOwner = GetOwner(); 
-    FVector NewLocation = pOwner->​GetActorLocation();​ 
-    float DeltaHeight = (FMath::​Cos(m_fRunningTime + DeltaTime) - FMath::​Cos(m_fRunningTime));​ 
-    NewLocation.X += DeltaHeight * 20.0f; 
-    m_fRunningTime += DeltaTime; 
-    pOwner->​SetActorLocation(NewLocation);​ 
-} 
-</​code>​ 
Permalink wiki/ue4/tips/501.1427536324.txt.gz · 最終更新: 2015/03/28 09:52 by step

oeffentlich