1 在AuraEnemy.h中
增加注释,/** Enemy Interface */ ,/** end Enemy Interface */
protected:
virtual void beginplay();
2 在 AuraEnemy.cpp中
beginplay()
{
check(AbilitySystemComponent)
AbilitySystemComponent->InitAbilityActorInfo(this,this);
}
3 在AuraCharacter.h中
virtual void PossedBy() override;
virtual void OnRep_PlayerState() override;
private:
void InitAbilityActorInfo();
4 在AuraCharacter.cpp中
PossedBy()
{
InitAbilityActorInfo();
}
OnRep_PlayerState()
{
InitAbilityActorInfo();
}
InitAbilityActorInfo()
{
//Init ability Actor Info for the Server
AAuraPlayerState* AuraPlayerState = GetPlayerState<AAuraPlayerState>();
check(AuraPlayerState);
AuraPlayerState->GetAbilitySystemComponent()->InitAbilityActorInfo(AuraPlayerState,this);
AttributeSet = AuraPlayerState->GetAttributeSet();
}
浙公网安备 33010602011771号