UE4纯C++黑板Blackboard键添加(备忘

	//攻击类型
	FBlackboardEntry AttackType;
	AttackType.EntryName = FName("AttackType");
	UBlackboardKeyType_Enum* AttackTypeKeyType = NewObject();
	AttackTypeKeyType->EnumType = FindObject(ANY_PACKAGE, *FString("EEnemyAttackType"), true);
	AttackTypeKeyType->EnumName = FString("EEnemyAttackType");
	AttackType.KeyType = AttackTypeKeyType;

	//玩家指针
	FBlackboardEntry PlayerPawn;
	PlayerPawn.EntryName = FName("PlayerPawn");
	UBlackboardKeyType_Object* PlayerPawnKeyType = NewObject();
	PlayerPawnKeyType->BaseClass = ASlAiPlayerCharacter::StaticClass();
	PlayerPawn.KeyType = PlayerPawnKeyType;


    Keys.Add(AttackType);
	Keys.Add(PlayerPawn);

 

你可能感兴趣的:(行为树,UE4学习,C++)