void USoundNodeRandom::RemoveChildNode( int32 Index ) { FixWeightsArray(); FixHasBeenUsedArray(); check( Index >= 0 && Index < Weights.Num() ); check( ChildNodes.Num() == Weights.Num() ); Weights.RemoveAt( Index ); HasBeenUsed.RemoveAt( Index ); Super::RemoveChildNode( Index ); }
void USoundNodeRandom::InsertChildNode( int32 Index ) { FixWeightsArray(); FixHasBeenUsedArray(); check( Index >= 0 && Index <= Weights.Num() ); check( ChildNodes.Num() == Weights.Num() ); Weights.InsertUninitialized( Index ); Weights[Index] = 1.0f; HasBeenUsed.InsertUninitialized( Index ); HasBeenUsed[ Index ] = false; Super::InsertChildNode( Index ); }
void USoundNodeRandom::PostLoad() { Super::PostLoad(); if (!GIsEditor && PreselectAtLevelLoad > 0) { while (ChildNodes.Num() > PreselectAtLevelLoad) { RemoveChildNode(FMath::Rand() % ChildNodes.Num()); } } #if WITH_EDITOR else if (GEditor != nullptr && (GEditor->bIsSimulatingInEditor || GEditor->PlayWorld != NULL)) { UpdatePIEHiddenNodes(); } #endif //WITH_EDITOR FixWeightsArray(); FixHasBeenUsedArray(); }