Add OnStaticFlagsChanged to Actor
This commit is contained in:
@@ -609,7 +609,10 @@ void Actor::SetIsActive(bool value)
|
|||||||
|
|
||||||
void Actor::SetStaticFlags(StaticFlags value)
|
void Actor::SetStaticFlags(StaticFlags value)
|
||||||
{
|
{
|
||||||
|
if (_staticFlags == value)
|
||||||
|
return;
|
||||||
_staticFlags = value;
|
_staticFlags = value;
|
||||||
|
OnStaticFlagsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::SetTransform(const Transform& value)
|
void Actor::SetTransform(const Transform& value)
|
||||||
@@ -1226,6 +1229,14 @@ void Actor::OnOrderInParentChanged()
|
|||||||
Level::callActorEvent(Level::ActorEventType::OnActorOrderInParentChanged, this, nullptr);
|
Level::callActorEvent(Level::ActorEventType::OnActorOrderInParentChanged, this, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Actor::OnStaticFlagsChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Actor::OnLayerChanged()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
BoundingBox Actor::GetBoxWithChildren() const
|
BoundingBox Actor::GetBoxWithChildren() const
|
||||||
{
|
{
|
||||||
BoundingBox result = GetBox();
|
BoundingBox result = GetBox();
|
||||||
|
|||||||
@@ -886,14 +886,12 @@ public:
|
|||||||
/// Gets rotation of the actor oriented towards the specified world position with upwards direction.
|
/// Gets rotation of the actor oriented towards the specified world position with upwards direction.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="worldPos">The world position to orient towards.</param>
|
/// <param name="worldPos">The world position to orient towards.</param>
|
||||||
/// <param name="worldUp">The up direction that Constrains y axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.</param>
|
/// <param name="worldUp">The up direction that constrains up axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.</param>
|
||||||
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
|
API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Execute custom action on actors tree.
|
/// Execute custom action on actors tree.
|
||||||
/// Action should returns false to stop calling deeper.
|
|
||||||
/// First action argument is current actor object.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action">Actor to call on every actor in the tree. Returns true if keep calling deeper.</param>
|
/// <param name="action">Actor to call on every actor in the tree. Returns true if keep calling deeper.</param>
|
||||||
/// <param name="args">Custom arguments for the function</param>
|
/// <param name="args">Custom arguments for the function</param>
|
||||||
@@ -903,14 +901,12 @@ public:
|
|||||||
if (action(this, args...))
|
if (action(this, args...))
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < Children.Count(); i++)
|
for (int32 i = 0; i < Children.Count(); i++)
|
||||||
Children[i]->TreeExecute<Params...>(action, args...);
|
Children.Get()[i]->TreeExecute<Params...>(action, args...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Execute custom action on actor children tree.
|
/// Execute custom action on actor children tree.
|
||||||
/// Action should returns false to stop calling deeper.
|
|
||||||
/// First action argument is current actor object.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action">Actor to call on every actor in the tree. Returns true if keep calling deeper.</param>
|
/// <param name="action">Actor to call on every actor in the tree. Returns true if keep calling deeper.</param>
|
||||||
/// <param name="args">Custom arguments for the function</param>
|
/// <param name="args">Custom arguments for the function</param>
|
||||||
@@ -918,7 +914,7 @@ public:
|
|||||||
void TreeExecuteChildren(Function<bool(Actor*, Params ...)>& action, Params ... args)
|
void TreeExecuteChildren(Function<bool(Actor*, Params ...)>& action, Params ... args)
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < Children.Count(); i++)
|
for (int32 i = 0; i < Children.Count(); i++)
|
||||||
Children[i]->TreeExecute<Params...>(action, args...);
|
Children.Get()[i]->TreeExecute<Params...>(action, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -1016,12 +1012,15 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
virtual void OnOrderInParentChanged();
|
virtual void OnOrderInParentChanged();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when actor static flag gets changed.
|
||||||
|
/// </summary>
|
||||||
|
virtual void OnStaticFlagsChanged();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when layer gets changed.
|
/// Called when layer gets changed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
virtual void OnLayerChanged()
|
virtual void OnLayerChanged();
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when adding object to the game.
|
/// Called when adding object to the game.
|
||||||
|
|||||||
Reference in New Issue
Block a user