Merge remote-tracking branch 'origin/master' into gi
This commit is contained in:
@@ -419,6 +419,17 @@ Array<Actor*> Actor::GetChildren(const MClass* type) const
|
||||
return result;
|
||||
}
|
||||
|
||||
void Actor::DestroyChildren(float timeLeft)
|
||||
{
|
||||
Array<Actor*> children = Children;
|
||||
const bool useGameTime = timeLeft > ZeroTolerance;
|
||||
for (Actor* child : children)
|
||||
{
|
||||
child->SetParent(nullptr, false, false);
|
||||
child->DeleteObject(timeLeft, useGameTime);
|
||||
}
|
||||
}
|
||||
|
||||
bool Actor::HasTag(const StringView& tag) const
|
||||
{
|
||||
return HasTag() && tag == Level::Tags[_tag];
|
||||
|
||||
@@ -296,23 +296,6 @@ namespace FlaxEngine
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroys the children. Calls Object.Destroy on every child actor and unlink them for the parent.
|
||||
/// </summary>
|
||||
/// <param name="timeLeft">The time left to destroy object (in seconds).</param>
|
||||
[NoAnimate]
|
||||
public void DestroyChildren(float timeLeft = 0.0f)
|
||||
{
|
||||
if (ChildrenCount == 0)
|
||||
return;
|
||||
Actor[] children = Children;
|
||||
for (var i = 0; i < children.Length; i++)
|
||||
{
|
||||
children[i].Parent = null;
|
||||
Destroy(children[i], timeLeft);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the matrix that transforms a point from the world space to local space of the actor.
|
||||
/// </summary>
|
||||
|
||||
@@ -244,6 +244,12 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroys the children. Calls Object.Destroy on every child actor and unlinks them for this actor.
|
||||
/// </summary>
|
||||
/// <param name="timeLeft">The time left to destroy object (in seconds).</param>
|
||||
API_FUNCTION(Attributes="NoAnimate") void DestroyChildren(float timeLeft = 0.0f);
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -325,7 +325,7 @@ void AnimatedModel::ClearBlendShapeWeights()
|
||||
_blendShapes.Clear();
|
||||
}
|
||||
|
||||
void AnimatedModel::PlaySlotAnimation(const StringView& slotName, Animation* anim, float speed, float blendInTime, float blendOutTime)
|
||||
void AnimatedModel::PlaySlotAnimation(const StringView& slotName, Animation* anim, float speed, float blendInTime, float blendOutTime, int32 loopCount)
|
||||
{
|
||||
CHECK(anim);
|
||||
for (auto& slot : GraphInstance.Slots)
|
||||
@@ -334,6 +334,7 @@ void AnimatedModel::PlaySlotAnimation(const StringView& slotName, Animation* ani
|
||||
{
|
||||
slot.Pause = false;
|
||||
slot.BlendInTime = blendInTime;
|
||||
slot.LoopCount = loopCount;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -351,6 +352,7 @@ void AnimatedModel::PlaySlotAnimation(const StringView& slotName, Animation* ani
|
||||
slot.Speed = speed;
|
||||
slot.BlendInTime = blendInTime;
|
||||
slot.BlendOutTime = blendOutTime;
|
||||
slot.LoopCount = loopCount;
|
||||
}
|
||||
|
||||
void AnimatedModel::StopSlotAnimation()
|
||||
|
||||
@@ -313,7 +313,8 @@ public:
|
||||
/// <param name="speed">The playback speed.</param>
|
||||
/// <param name="blendInTime">The animation blending in time (in seconds). Cam be used to smooth the slot animation playback with the input pose when starting the animation.</param>
|
||||
/// <param name="blendOutTime">The animation blending out time (in seconds). Cam be used to smooth the slot animation playback with the input pose when ending animation.</param>
|
||||
API_FUNCTION() void PlaySlotAnimation(const StringView& slotName, Animation* anim, float speed = 1.0f, float blendInTime = 0.2f, float blendOutTime = 0.2f);
|
||||
/// <param name="loopCount">The amount of loops to play the animation: 0 to play once, -1 to play infinite, 1 or higher to loop once or more.</param>
|
||||
API_FUNCTION() void PlaySlotAnimation(const StringView& slotName, Animation* anim, float speed = 1.0f, float blendInTime = 0.2f, float blendOutTime = 0.2f, int32 loopCount = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Stops all the animations playback on the all slots in Anim Graph.
|
||||
|
||||
Reference in New Issue
Block a user