0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UE勉強日記 ID自動付与

Posted at

actorをインスタン化するたびに、
インスタンス化した回数と同じようにID自動付与する

.h

static int32 NextID;

.cpp

int32 AActor::NextID = 1;

AActor::AActor()
{
     ID = FString::Printf(TEXT("%d"), NextID++);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?