本文整理匯總了C++中GetOuter函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetOuter函數的具體用法?C++ GetOuter怎麽用?C++ GetOuter使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetOuter函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: UpdateAsset
void UEnvironmentQueryGraph::UpdateAsset(int32 UpdateFlags)
{
if (IsLocked())
{
return;
}
// let's find root node
UEnvironmentQueryGraphNode_Root* RootNode = NULL;
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
{
RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]);
if (RootNode != NULL)
{
break;
}
}
UEnvQuery* Query = Cast<UEnvQuery>(GetOuter());
Query->GetOptionsMutable().Reset();
if (RootNode && RootNode->Pins.Num() > 0 && RootNode->Pins[0]->LinkedTo.Num() > 0)
{
UEdGraphPin* MyPin = RootNode->Pins[0];
// sort connections so that they're organized the same as user can see in the editor
MyPin->LinkedTo.Sort(FCompareNodeXLocation());
for (int32 Idx = 0; Idx < MyPin->LinkedTo.Num(); Idx++)
{
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(MyPin->LinkedTo[Idx]->GetOwningNode());
if (OptionNode)
{
OptionNode->UpdateNodeData();
UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance);
if (OptionInstance && OptionInstance->Generator)
{
OptionInstance->Tests.Reset();
for (int32 TestIdx = 0; TestIdx < OptionNode->SubNodes.Num(); TestIdx++)
{
UAIGraphNode* SubNode = OptionNode->SubNodes[TestIdx];
if (SubNode == nullptr)
{
continue;
}
SubNode->ParentNode = OptionNode;
UEnvironmentQueryGraphNode_Test* TestNode = Cast<UEnvironmentQueryGraphNode_Test>(SubNode);
if (TestNode && TestNode->bTestEnabled)
{
UEnvQueryTest* TestInstance = Cast<UEnvQueryTest>(TestNode->NodeInstance);
if (TestInstance)
{
OptionInstance->Tests.Add(TestInstance);
}
}
}
Query->GetOptionsMutable().Add(OptionInstance);
}
// FORT-16508 tracking BEGIN: log invalid option
if (OptionInstance && OptionInstance->Generator == nullptr)
{
FString DebugMessage = FString::Printf(TEXT("[%s] UpdateAsset found option instance [pin:%d] without a generator! tests:%d"),
FPlatformTime::StrTimestamp(), Idx, OptionNode->SubNodes.Num());
RootNode->LogDebugMessage(DebugMessage);
}
else if (OptionInstance == nullptr)
{
FString DebugMessage = FString::Printf(TEXT("[%s] UpdateAsset found option node [pin:%d] without an instance! tests:%d"),
FPlatformTime::StrTimestamp(), Idx, OptionNode->SubNodes.Num());
RootNode->LogDebugMessage(DebugMessage);
}
// FORT-16508 tracking END
}
}
}
RemoveOrphanedNodes();
// FORT-16508 tracking BEGIN: find corrupted options
if (RootNode)
{
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
{
UEnvironmentQueryGraphNode_Option* OptionNode = Cast<UEnvironmentQueryGraphNode_Option>(Nodes[Idx]);
if (OptionNode)
{
UEnvQueryOption* OptionInstance = Cast<UEnvQueryOption>(OptionNode->NodeInstance);
if (OptionNode->NodeInstance == nullptr || OptionInstance == nullptr || OptionInstance->HasAnyFlags(RF_Transient))
{
FString DebugMessage = FString::Printf(TEXT("[%s] found corrupted node after RemoveOrphanedNodes! type:instance option:%s instance:%d transient:%d tests:%d"),
FPlatformTime::StrTimestamp(),
*GetNameSafe(OptionNode),
OptionNode->NodeInstance ? (OptionInstance ? 1 : -1) : 0,
//.........這裏部分代碼省略.........
示例2: if
void UK2Node_Composite::PostPasteNode()
{
Super::PostPasteNode();
//@TODO: Should verify that each node in the composite can be pasted into this new graph successfully (CanPasteHere)
if (BoundGraph != NULL)
{
UEdGraph* ParentGraph = CastChecked<UEdGraph>(GetOuter());
ensure(BoundGraph != ParentGraph);
// Update the InputSinkNode / OutputSourceNode pointers to point to the new graph
TSet<UEdGraphNode*> BoundaryNodes;
for (int32 NodeIndex = 0; NodeIndex < BoundGraph->Nodes.Num(); ++NodeIndex)
{
UEdGraphNode* Node = BoundGraph->Nodes[NodeIndex];
//Remove this node if it should not exist more then one in blueprint
if(UK2Node_Event* Event = Cast<UK2Node_Event>(Node))
{
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraphChecked(BoundGraph);
if(FBlueprintEditorUtils::FindOverrideForFunction(BP, Event->EventReference.GetMemberParentClass(Event), Event->EventReference.GetMemberName()))
{
FBlueprintEditorUtils::RemoveNode(BP, Node, true);
NodeIndex--;
continue;
}
}
BoundaryNodes.Add(Node);
if (Node->GetClass() == UK2Node_Tunnel::StaticClass())
{
// Exactly a tunnel node, should be the entrance or exit node
UK2Node_Tunnel* Tunnel = CastChecked<UK2Node_Tunnel>(Node);
if (Tunnel->bCanHaveInputs && !Tunnel->bCanHaveOutputs)
{
OutputSourceNode = Tunnel;
Tunnel->InputSinkNode = this;
}
else if (Tunnel->bCanHaveOutputs && !Tunnel->bCanHaveInputs)
{
InputSinkNode = Tunnel;
Tunnel->OutputSourceNode = this;
}
else
{
ensureMsgf(false, *LOCTEXT("UnexpectedTunnelNode", "Unexpected tunnel node '%s' in cloned graph '%s' (both I/O or neither)").ToString(), *Tunnel->GetName(), *GetName());
}
}
}
RenameBoundGraphCloseToName(BoundGraph->GetName());
ensure(BoundGraph->SubGraphs.Find(ParentGraph) == INDEX_NONE);
//Nested composites will already be in the SubGraph array
if(ParentGraph->SubGraphs.Find(BoundGraph) == INDEX_NONE)
{
ParentGraph->SubGraphs.Add(BoundGraph);
}
FEdGraphUtilities::PostProcessPastedNodes(BoundaryNodes);
}
}
示例3: Msg
bool CAI_BlendedMotor::AddTurnGesture( float flYD )
{
// some funky bug with human turn gestures, disable for now
return false;
// try using a turn gesture
Activity activity = ACT_INVALID;
float weight = 1.0;
float turnCompletion = 1.0;
if (m_flNextTurnGesture > gpGlobals->curtime)
{
/*
if ( GetOuter()->m_debugOverlays & OVERLAY_NPC_SELECTED_BIT )
{
Msg( "%.1f : [ %.2f ]\n", flYD, m_flNextTurnAct - gpGlobals->curtime );
}
*/
return false;
}
if ( GetOuter()->IsMoving() || GetOuter()->IsCrouching() )
{
return false;
}
if (fabs( flYD ) < 15)
{
return false;
}
else if (flYD < -45)
{
activity = ACT_GESTURE_TURN_RIGHT90;
weight = flYD / -90;
turnCompletion = 0.36;
}
else if (flYD < 0)
{
activity = ACT_GESTURE_TURN_RIGHT45;
weight = flYD / -45;
turnCompletion = 0.4;
}
else if (flYD <= 45)
{
activity = ACT_GESTURE_TURN_LEFT45;
weight = flYD / 45;
turnCompletion = 0.4;
}
else
{
activity = ACT_GESTURE_TURN_LEFT90;
weight = flYD / 90;
turnCompletion = 0.36;
}
int seq = SelectWeightedSequence( activity );
if (scene_flatturn->GetBool() && GetOuter()->IsCurSchedule( SCHED_SCENE_GENERIC ))
{
Activity flatactivity = activity;
if (activity == ACT_GESTURE_TURN_RIGHT90)
{
flatactivity = ACT_GESTURE_TURN_RIGHT90_FLAT;
}
else if (activity == ACT_GESTURE_TURN_RIGHT45)
{
flatactivity = ACT_GESTURE_TURN_RIGHT45_FLAT;
}
else if (activity == ACT_GESTURE_TURN_LEFT90)
{
flatactivity = ACT_GESTURE_TURN_LEFT90_FLAT;
}
else if (activity == ACT_GESTURE_TURN_LEFT45)
{
flatactivity = ACT_GESTURE_TURN_LEFT45_FLAT;
}
if (flatactivity != activity)
{
int newseq = SelectWeightedSequence( flatactivity );
if (newseq != ACTIVITY_NOT_AVAILABLE)
{
seq = newseq;
}
}
}
if (seq != ACTIVITY_NOT_AVAILABLE)
{
int iLayer = GetOuter()->AddGestureSequence( seq );
if (iLayer != -1)
{
GetOuter()->SetLayerPriority( iLayer, 100 );
// vary the playback a bit
SetLayerPlaybackRate( iLayer, 1.0 );
float actualDuration = GetOuter()->GetLayerDuration( iLayer );
float rate = enginerandom->RandomFloat( 0.5, 1.1 );
//.........這裏部分代碼省略.........
示例4: GetOuter
//-----------------------------------------------------------------------------
// Purpose: Suppress melee attacks against enemies for the given duration
// Input : flDuration - Amount of time to suppress the attacks
//-----------------------------------------------------------------------------
void CAI_PassengerBehaviorZombie::SuppressAttack( float flDuration )
{
GetOuter()->SetNextAttack( gpGlobals->curtime + flDuration );
}
示例5: IsAMasterTrack
bool UMovieSceneAudioTrack::IsAMasterTrack() const
{
return Cast<UMovieScene>(GetOuter())->IsAMasterTrack(this);
}
示例6: switch
void CAI_LeadBehavior::RunTask( const Task_t *pTask )
{
switch ( pTask->iTask )
{
case TASK_LEAD_SUCCEED:
{
if ( !IsSpeaking() )
{
TaskComplete();
NotifyEvent( LBE_DONE );
}
break;
}
case TASK_LEAD_ARRIVE:
{
if ( !IsSpeaking() )
{
TaskComplete();
NotifyEvent( LBE_ARRIVAL_DONE );
}
break;
}
case TASK_LEAD_MOVE_TO_RANGE:
{
// If we haven't spoken our start speech, move closer
if ( !m_hasspokenstart)
{
ChainRunTask( TASK_MOVE_TO_GOAL_RANGE, m_leaddistance - 24 );
}
else
{
ChainRunTask( TASK_MOVE_TO_GOAL_RANGE, m_retrievedistance );
if ( !TaskIsComplete() )
{
// Transition to a walk when we get near the player
// Check Z first, and only check 2d if we're within that
Vector vecGoalPos = GetNavigator()->GetGoalPos();
float distance = fabs(vecGoalPos.z - GetLocalOrigin().z);
bool bWithinZ = false;
if ( distance < m_retrievedistance )
{
distance = ( vecGoalPos - GetLocalOrigin() ).Length2D();
bWithinZ = true;
}
if ( distance > m_retrievedistance )
{
Activity followActivity = ACT_WALK;
if ( GetOuter()->GetState() == NPC_STATE_COMBAT || (!bWithinZ || distance < (m_retrievedistance*4)) && GetOuter()->GetState() != NPC_STATE_COMBAT )
{
followActivity = ACT_RUN;
}
// Don't confuse move and shoot by resetting the activity every think
Activity curActivity = GetNavigator()->GetMovementActivity();
switch( curActivity )
{
case ACT_WALK_AIM: curActivity = ACT_WALK; break;
case ACT_RUN_AIM: curActivity = ACT_RUN; break;
}
if ( curActivity != followActivity )
{
GetNavigator()->SetMovementActivity(followActivity);
}
GetNavigator()->SetArrivalDirection( GetOuter()->GetTarget() );
}
}
}
break;
}
case TASK_LEAD_RETRIEVE_WAIT:
{
ChainRunTask( TASK_WAIT_INDEFINITE );
break;
}
case TASK_LEAD_WALK_PATH:
{
// If we're leading, and we're supposed to run, run instead of walking
if ( m_run &&
( IsCurSchedule( SCHED_LEAD_WAITFORPLAYER, false ) || IsCurSchedule( SCHED_LEAD_PLAYER, false ) || IsCurSchedule( SCHED_LEAD_SPEAK_THEN_LEAD_PLAYER, false )|| IsCurSchedule( SCHED_LEAD_RETRIEVE, false ) ) )
{
ChainRunTask( TASK_RUN_PATH );
}
else
{
ChainRunTask( TASK_WALK_PATH );
}
// While we're walking
if ( TaskIsRunning() && IsCurSchedule( SCHED_LEAD_PLAYER, false ) )
{
// If we're not speaking, and we haven't tried for a while, try to speak lead idle
if ( m_flNextLeadIdle < gpGlobals->curtime && !IsSpeaking() )
{
m_flNextLeadIdle = gpGlobals->curtime + RandomFloat( 10,15 );
//.........這裏部分代碼省略.........
示例7: GetOuter
void CAI_MoveAndShootOverlay::RunShootWhileMove()
{
if ( m_bNoShootWhileMove )
return;
if ( gpGlobals->curtime < m_flSuspendUntilTime )
return;
m_flSuspendUntilTime = MOVESHOOT_DO_NOT_SUSPEND;
CAI_BaseNPC *pOuter = GetOuter();
// keep enemy if dead but try to look for a new one
if (!pOuter->GetEnemy() || !pOuter->GetEnemy()->IsAlive())
{
CBaseEntity *pNewEnemy = pOuter->BestEnemy();
if( pNewEnemy != NULL )
{
//New enemy! Clear the timers and set conditions.
pOuter->SetEnemy( pNewEnemy );
pOuter->SetState( NPC_STATE_COMBAT );
}
else
{
pOuter->ClearAttackConditions();
}
// SetEnemy( NULL );
}
/*if( !pOuter->GetNavigator()->IsGoalActive() )
return;*/
if ( GetEnemy() == NULL )
{
if ( pOuter->GetAlternateMoveShootTarget() )
{
// Aim at this other thing if I can't aim at my enemy.
pOuter->AddFacingTarget( pOuter->GetAlternateMoveShootTarget(), pOuter->GetAlternateMoveShootTarget()->GetAbsOrigin(), 1.0, 0.2 );
}
return;
}
bool bMoveAimAtEnemy = CanAimAtEnemy();
UpdateMoveShootActivity( bMoveAimAtEnemy );
if ( !bMoveAimAtEnemy )
{
EndShootWhileMove();
return;
}
Assert( HasAvailableRangeAttack() ); // This should have been caught at task start
Activity activity;
bool bIsReloading = false;
if ( ( activity = pOuter->TranslateActivity( ACT_GESTURE_RELOAD ) ) != ACT_INVALID )
{
bIsReloading = pOuter->IsPlayingGesture( activity );
}
if ( !bIsReloading && HasAvailableRangeAttack() )
{
// time to fire?
if ( pOuter->HasCondition( COND_CAN_RANGE_ATTACK1, false ) )
{
if ( pOuter->GetShotRegulator()->IsInRestInterval() )
{
EndShootWhileMove();
}
else if ( pOuter->GetShotRegulator()->ShouldShoot() )
{
if ( m_bMovingAndShooting || pOuter->OnBeginMoveAndShoot() )
{
m_bMovingAndShooting = true;
pOuter->OnRangeAttack1();
activity = pOuter->TranslateActivity( ACT_GESTURE_RANGE_ATTACK1 );
Assert( activity != ACT_INVALID );
pOuter->RestartGesture( activity );
// FIXME: this seems a bit wacked
pOuter->Weapon_SetActivity( pOuter->Weapon_TranslateActivity( ACT_RANGE_ATTACK1 ), 0 );
}
}
}
}
// try to keep facing towards the last known position of the enemy
Vector vecEnemyLKP = pOuter->GetEnemyLKP();
pOuter->AddFacingTarget( pOuter->GetEnemy(), vecEnemyLKP, 1.0, 0.8 );
}
示例8: GetOuter
bool UObjectBaseUtility::IsDefaultSubobject() const
{
const bool bIsInstanced = GetOuter() && (GetOuter()->HasAnyFlags(RF_ClassDefaultObject) || ((UObject*)this)->GetArchetype() != GetClass()->GetDefaultObject());
return bIsInstanced;
}
示例9: AI_PROFILE_SCOPE
bool CAI_TacticalServices::FindLateralLos( const Vector &vecThreat, Vector *pResult )
{
AI_PROFILE_SCOPE( CAI_TacticalServices_FindLateralLos );
if( !m_bAllowFindLateralLos )
{
return false;
}
MARK_TASK_EXPENSIVE();
Vector vecLeftTest;
Vector vecRightTest;
Vector vecStepRight;
Vector vecCheckStart;
bool bLookingForEnemy = GetEnemy() && VectorsAreEqual(vecThreat, GetEnemy()->EyePosition(), 0.1f);
int i;
if( !bLookingForEnemy || GetOuter()->HasCondition(COND_SEE_ENEMY) || GetOuter()->HasCondition(COND_HAVE_ENEMY_LOS) ||
GetOuter()->GetTimeScheduleStarted() == gpGlobals->curtime ) // Conditions get nuked before tasks run, assume should try
{
// My current position might already be valid.
if ( TestLateralLos(vecThreat, GetLocalOrigin()) )
{
*pResult = GetLocalOrigin();
return true;
}
}
if( !ai_find_lateral_los.GetBool() )
{
// Allows us to turn off lateral LOS at the console. Allow the above code to run
// just in case the NPC has line of sight to begin with.
return false;
}
int iChecks = COVER_CHECKS;
int iDelta = COVER_DELTA;
// If we're limited in how far we're allowed to move laterally, don't bother checking past it
int iMaxLateralDelta = (int)GetOuter()->GetMaxTacticalLateralMovement();
if ( iMaxLateralDelta != MAXTACLAT_IGNORE && iMaxLateralDelta < iDelta )
{
iChecks = 1;
iDelta = iMaxLateralDelta;
}
Vector right;
AngleVectors( GetLocalAngles(), NULL, &right, NULL );
vecStepRight = right * iDelta;
vecStepRight.z = 0;
vecLeftTest = vecRightTest = GetLocalOrigin();
vecCheckStart = vecThreat;
for ( i = 0 ; i < iChecks; i++ )
{
vecLeftTest = vecLeftTest - vecStepRight;
vecRightTest = vecRightTest + vecStepRight;
if (TestLateralLos( vecCheckStart, vecLeftTest ))
{
*pResult = vecLeftTest;
return true;
}
if (TestLateralLos( vecCheckStart, vecRightTest ))
{
*pResult = vecRightTest;
return true;
}
}
return false;
}
示例10: check
bool UActorComponent::NeedsLoadForServer() const
{
check(GetOuter());
return (GetOuter()->NeedsLoadForServer() && Super::NeedsLoadForServer());
}
示例11: SpawnMissingNodes
void UEnvironmentQueryGraph::SpawnMissingNodes()
{
UEnvQuery* QueryOwner = Cast<UEnvQuery>(GetOuter());
if (QueryOwner == nullptr)
{
return;
}
TSet<UEnvQueryTest*> ExistingTests;
TSet<UEnvQueryOption*> ExistingNodes;
TArray<UEnvQueryOption*> OptionsCopy = QueryOwner->GetOptions();
UAIGraphNode* MyRootNode = nullptr;
for (int32 Idx = 0; Idx < Nodes.Num(); Idx++)
{
UEnvironmentQueryGraphNode* MyNode = Cast<UEnvironmentQueryGraphNode>(Nodes[Idx]);
UEnvQueryOption* OptionInstance = MyNode ? Cast<UEnvQueryOption>(MyNode->NodeInstance) : nullptr;
if (OptionInstance && OptionInstance->Generator)
{
ExistingNodes.Add(OptionInstance);
ExistingTests.Empty(ExistingTests.Num());
for (int32 SubIdx = 0; SubIdx < MyNode->SubNodes.Num(); SubIdx++)
{
UEnvironmentQueryGraphNode* MySubNode = Cast<UEnvironmentQueryGraphNode>(MyNode->SubNodes[SubIdx]);
UEnvQueryTest* TestInstance = MySubNode ? Cast<UEnvQueryTest>(MySubNode->NodeInstance) : nullptr;
if (TestInstance)
{
ExistingTests.Add(TestInstance);
}
else
{
MyNode->RemoveSubNode(MySubNode);
SubIdx--;
}
}
SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode);
}
UEnvironmentQueryGraphNode_Root* RootNode = Cast<UEnvironmentQueryGraphNode_Root>(Nodes[Idx]);
if (RootNode)
{
MyRootNode = RootNode;
}
}
UEdGraphPin* RootOutPin = MyRootNode ? FindGraphNodePin(MyRootNode, EGPD_Output) : nullptr;
ExistingTests.Empty(0);
for (int32 Idx = 0; Idx < OptionsCopy.Num(); Idx++)
{
UEnvQueryOption* OptionInstance = OptionsCopy[Idx];
if (ExistingNodes.Contains(OptionInstance) || OptionInstance == nullptr || OptionInstance->Generator == nullptr)
{
continue;
}
FGraphNodeCreator<UEnvironmentQueryGraphNode_Option> NodeBuilder(*this);
UEnvironmentQueryGraphNode_Option* MyNode = NodeBuilder.CreateNode();
UAIGraphNode::UpdateNodeClassDataFrom(OptionInstance->Generator->GetClass(), MyNode->ClassData);
MyNode->ErrorMessage = MyNode->ClassData.GetDeprecatedMessage();
NodeBuilder.Finalize();
if (MyRootNode)
{
MyNode->NodePosX = MyRootNode->NodePosX + (Idx * 300);
MyNode->NodePosY = MyRootNode->NodePosY + 100;
}
MyNode->NodeInstance = OptionInstance;
SpawnMissingSubNodes(OptionInstance, ExistingTests, MyNode);
UEdGraphPin* SpawnedInPin = FindGraphNodePin(MyNode, EGPD_Input);
if (RootOutPin && SpawnedInPin)
{
RootOutPin->MakeLinkTo(SpawnedInPin);
}
}
}
示例12: AI_GetSinglePlayer
int CAI_LeadBehavior::SelectSchedule()
{
if ( HasGoal() )
{
if( HasCondition(COND_LEAD_SUCCESS) )
{
return SCHED_LEAD_SUCCEED;
}
// Player's here, but does he have the weapon we want him to have?
if ( m_weaponname != NULL_STRING )
{
CBasePlayer *pFollower = AI_GetSinglePlayer();
if ( pFollower && !pFollower->Weapon_OwnsThisType( STRING(m_weaponname) ) )
{
// If the safety timeout has run out, just give the player the weapon
if ( !m_flWeaponSafetyTimeOut || (m_flWeaponSafetyTimeOut > gpGlobals->curtime) )
return SCHED_LEAD_PLAYERNEEDSWEAPON;
string_t iszItem = AllocPooledString( "weapon_bugbait" );
pFollower->GiveNamedItem( STRING(iszItem) );
}
}
// If we have a waitpoint, we want to wait at it for the player.
if( HasWaitPoint() && !PlayerIsAheadOfMe( true ) )
{
bool bKeepWaiting = true;
// If we have no wait distance, trigger as soon as the player comes in view
if ( !m_waitdistance )
{
if ( HasCondition( COND_SEE_PLAYER ) )
{
// We've spotted the player, so stop waiting
bKeepWaiting = false;
}
}
else
{
// We have to collect data about the person we're leading around.
CBaseEntity *pFollower = AI_GetSinglePlayer();
if( pFollower )
{
float flFollowerDist = ( WorldSpaceCenter() - pFollower->WorldSpaceCenter() ).Length();
if ( flFollowerDist < m_waitdistance )
{
bKeepWaiting = false;
}
}
}
// Player still not here?
if ( bKeepWaiting )
return SCHED_LEAD_WAITFORPLAYER;
// We're finished waiting
m_waitpoint = vec3_origin;
Speak( TLK_LEAD_WAITOVER );
// Don't speak the start line, because we've said
m_hasspokenstart = true;
return SCHED_WAIT_FOR_SPEAK_FINISH;
}
// If we haven't spoken our start speech, do that first
if ( !m_hasspokenstart )
{
if ( HasCondition(COND_LEAD_HAVE_FOLLOWER_LOS) && HasCondition(COND_LEAD_FOLLOWER_VERY_CLOSE) )
return SCHED_LEAD_SPEAK_START;
// We haven't spoken to him, and we still need to. Go get him.
return SCHED_LEAD_RETRIEVE;
}
if( HasCondition( COND_LEAD_FOLLOWER_LOST ) )
{
if( m_args.iRetrievePlayer )
{
// If not, we want to go get the player.
DevMsg( GetOuter(), "Follower lost. Spoke COMING_BACK.\n");
Speak( TLK_LEAD_COMINGBACK );
m_MoveMonitor.ClearMark();
// If we spoke something, wait for it to finish
if ( m_args.iComingBackWaitForSpeak && IsSpeaking() )
return SCHED_LEAD_SPEAK_THEN_RETRIEVE_PLAYER;
return SCHED_LEAD_RETRIEVE;
}
else
{
// Just stay right here and wait.
return SCHED_LEAD_WAITFORPLAYERIDLE;
}
}
if( HasCondition( COND_LEAD_FOLLOWER_LAGGING ) )
{
//.........這裏部分代碼省略.........
示例13: GetGraph
UWALandscapeGraph* UWALandscapeNode::GetGraph()
{
return Cast<UWALandscapeGraph>(GetOuter());
}
示例14: GetOwningAbilitySystemComponent
UAbilitySystemComponent* UAttributeSet::GetOwningAbilitySystemComponent() const
{
return UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(CastChecked<AActor>(GetOuter()));
}
示例15: Modify
void AActor::SetActorLabelInternal( const FString& NewActorLabelDirty, bool bMakeGloballyUniqueFName, bool bMarkDirty )
{
// Clean up the incoming string a bit
FString NewActorLabel = NewActorLabelDirty;
NewActorLabel.Trim();
NewActorLabel.TrimTrailing();
// First, update the actor label
{
// Has anything changed?
if( FCString::Strcmp( *NewActorLabel, *GetActorLabel() ) != 0 )
{
// Store new label
Modify( bMarkDirty );
ActorLabel = NewActorLabel;
}
}
// Next, update the actor's name
{
// Generate an object name for the actor's label
const FName OldActorName = GetFName();
FName NewActorName = MakeObjectNameFromActorLabel( GetActorLabel(), OldActorName );
// Has anything changed?
if( OldActorName != NewActorName )
{
// Try to rename the object
UObject* NewOuter = NULL; // Outer won't be changing
ERenameFlags RenFlags = bMakeGloballyUniqueFName ? (REN_DontCreateRedirectors | REN_ForceGlobalUnique) : REN_DontCreateRedirectors;
bool bCanRename = Rename( *NewActorName.ToString(), NewOuter, REN_Test | REN_DoNotDirty | REN_NonTransactional | RenFlags );
if( bCanRename )
{
// NOTE: Will assert internally if rename fails
const bool bWasRenamed = Rename( *NewActorName.ToString(), NewOuter, RenFlags );
}
else
{
// Unable to rename the object. Use a unique object name variant.
NewActorName = MakeUniqueObjectName( bMakeGloballyUniqueFName ? ANY_PACKAGE : GetOuter(), GetClass(), NewActorName );
bCanRename = Rename( *NewActorName.ToString(), NewOuter, REN_Test | REN_DoNotDirty | REN_NonTransactional | RenFlags );
if( bCanRename )
{
// NOTE: Will assert internally if rename fails
const bool bWasRenamed = Rename( *NewActorName.ToString(), NewOuter, RenFlags );
}
else
{
// Unable to rename the object. Oh well, not a big deal.
}
}
}
}
FPropertyChangedEvent PropertyEvent( FindField<UProperty>( AActor::StaticClass(), "ActorLabel" ) );
PostEditChangeProperty(PropertyEvent);
FCoreDelegates::OnActorLabelChanged.Broadcast(this);
}