Merge remote-tracking branch 'origin/master' into 1.7
# Conflicts: # Flax.flaxproj
This commit is contained in:
@@ -886,6 +886,14 @@ void Actor::EndPlay()
|
||||
OnDisable();
|
||||
}
|
||||
|
||||
for (auto* script : Scripts)
|
||||
{
|
||||
CHECK_EXECUTE_IN_EDITOR
|
||||
{
|
||||
script->OnDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
OnEndPlay();
|
||||
|
||||
// Clear flag
|
||||
@@ -899,15 +907,6 @@ void Actor::EndPlay()
|
||||
e->EndPlay();
|
||||
}
|
||||
|
||||
// Fire event for scripting
|
||||
for (auto* script : Scripts)
|
||||
{
|
||||
CHECK_EXECUTE_IN_EDITOR
|
||||
{
|
||||
script->OnDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
// Inform attached scripts
|
||||
for (int32 i = 0; i < Scripts.Count(); i++)
|
||||
{
|
||||
|
||||
@@ -416,6 +416,8 @@ void Camera::Serialize(SerializeStream& stream, const void* otherObj)
|
||||
SERIALIZE_MEMBER(Far, _far);
|
||||
SERIALIZE_MEMBER(OrthoScale, _orthoScale);
|
||||
SERIALIZE(RenderLayersMask);
|
||||
SERIALIZE(RenderFlags);
|
||||
SERIALIZE(RenderMode);
|
||||
}
|
||||
|
||||
void Camera::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
|
||||
@@ -430,6 +432,8 @@ void Camera::Deserialize(DeserializeStream& stream, ISerializeModifier* modifier
|
||||
DESERIALIZE_MEMBER(Far, _far);
|
||||
DESERIALIZE_MEMBER(OrthoScale, _orthoScale);
|
||||
DESERIALIZE(RenderLayersMask);
|
||||
DESERIALIZE(RenderFlags);
|
||||
DESERIALIZE(RenderMode);
|
||||
}
|
||||
|
||||
void Camera::OnEnable()
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Engine/Core/Math/Viewport.h"
|
||||
#include "Engine/Core/Math/Ray.h"
|
||||
#include "Engine/Core/Types/LayersMask.h"
|
||||
#include "Engine/Graphics/Enums.h"
|
||||
#include "Engine/Scripting/ScriptingObjectReference.h"
|
||||
#if USE_EDITOR
|
||||
#include "Engine/Content/AssetReference.h"
|
||||
@@ -134,6 +135,18 @@ public:
|
||||
API_FIELD(Attributes="EditorOrder(100), EditorDisplay(\"Camera\")")
|
||||
LayersMask RenderLayersMask;
|
||||
|
||||
/// <summary>
|
||||
/// Frame rendering flags used to switch between graphics features for this camera.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes = "EditorOrder(110), EditorDisplay(\"Camera\")")
|
||||
ViewFlags RenderFlags = ViewFlags::DefaultGame;
|
||||
|
||||
/// <summary>
|
||||
/// Describes frame rendering modes for this camera.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes = "EditorOrder(120), EditorDisplay(\"Camera\")")
|
||||
ViewMode RenderMode = ViewMode::Default;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Projects the point from 3D world-space to game window coordinates (in screen pixels for default viewport calculated from <see cref="Viewport"/>).
|
||||
|
||||
@@ -30,18 +30,18 @@ public:
|
||||
API_FIELD(Attributes="EditorOrder(3), DefaultValue(0.0f), EditorDisplay(\"Light\"), Limit(0, 1000, 0.01f)")
|
||||
float SourceLength = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Controls the radial falloff of light when UseInverseSquaredFalloff is disabled.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(13), DefaultValue(8.0f), EditorDisplay(\"Light\"), Limit(2, 16, 0.01f), VisibleIf(nameof(UseInverseSquaredFalloff), true)")
|
||||
float FallOffExponent = 8.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to use physically based inverse squared distance falloff, where Radius is only clamping the light's contribution.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(14), DefaultValue(false), EditorDisplay(\"Light\")")
|
||||
API_FIELD(Attributes = "EditorOrder(13), DefaultValue(false), EditorDisplay(\"Light\")")
|
||||
bool UseInverseSquaredFalloff = false;
|
||||
|
||||
/// <summary>
|
||||
/// Controls the radial falloff of light when UseInverseSquaredFalloff is disabled.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(14), DefaultValue(8.0f), EditorDisplay(\"Light\"), Limit(2, 16, 0.01f), VisibleIf(nameof(UseInverseSquaredFalloff), true)")
|
||||
float FallOffExponent = 8.0f;
|
||||
|
||||
/// <summary>
|
||||
/// IES texture (light profiles from real world measured data)
|
||||
/// </summary>
|
||||
|
||||
@@ -29,18 +29,18 @@ public:
|
||||
API_FIELD(Attributes="EditorOrder(2), DefaultValue(0.0f), EditorDisplay(\"Light\"), Limit(0, 1000, 0.01f)")
|
||||
float SourceRadius = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Controls the radial falloff of light when UseInverseSquaredFalloff is disabled.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(13), DefaultValue(8.0f), EditorDisplay(\"Light\"), Limit(2, 16, 0.01f), VisibleIf(nameof(UseInverseSquaredFalloff), true)")
|
||||
float FallOffExponent = 8.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to use physically based inverse squared distance falloff, where Radius is only clamping the light's contribution.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(14), DefaultValue(false), EditorDisplay(\"Light\")")
|
||||
API_FIELD(Attributes = "EditorOrder(13), DefaultValue(false), EditorDisplay(\"Light\")")
|
||||
bool UseInverseSquaredFalloff = false;
|
||||
|
||||
/// <summary>
|
||||
/// Controls the radial falloff of light when UseInverseSquaredFalloff is disabled.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(14), DefaultValue(8.0f), EditorDisplay(\"Light\"), Limit(2, 16, 0.01f), VisibleIf(nameof(UseInverseSquaredFalloff), true)")
|
||||
float FallOffExponent = 8.0f;
|
||||
|
||||
/// <summary>
|
||||
/// IES texture (light profiles from real world measured data)
|
||||
/// </summary>
|
||||
|
||||
@@ -332,6 +332,8 @@ bool PrefabManager::CreatePrefab(Actor* targetActor, const StringView& outputPat
|
||||
// Serialize to json data
|
||||
ASSERT(!IsCreatingPrefab);
|
||||
IsCreatingPrefab = true;
|
||||
const Guid targetPrefabId = targetActor->GetPrefabID();
|
||||
const bool hasTargetPrefabId = targetPrefabId.IsValid();
|
||||
rapidjson_flax::StringBuffer actorsDataBuffer;
|
||||
{
|
||||
CompactJsonWriter writerObj(actorsDataBuffer);
|
||||
@@ -340,7 +342,27 @@ bool PrefabManager::CreatePrefab(Actor* targetActor, const StringView& outputPat
|
||||
for (int32 i = 0; i < sceneObjects->Count(); i++)
|
||||
{
|
||||
SceneObject* obj = sceneObjects->At(i);
|
||||
|
||||
// Detect when creating prefab from object that is already part of prefab then serialize it as unlinked
|
||||
const Guid prefabId = obj->GetPrefabID();
|
||||
const Guid prefabObjectId = obj->GetPrefabObjectID();
|
||||
bool isObjectFromPrefab = targetPrefabId == prefabId && prefabId.IsValid(); // Allow to use other nested prefabs properly (ignore only root object's prefab link)
|
||||
if (isObjectFromPrefab)
|
||||
{
|
||||
//obj->BreakPrefabLink();
|
||||
obj->_prefabID = Guid::Empty;
|
||||
obj->_prefabObjectID = Guid::Empty;
|
||||
}
|
||||
|
||||
writer.SceneObject(obj);
|
||||
|
||||
// Restore broken link
|
||||
if (hasTargetPrefabId)
|
||||
{
|
||||
//obj->LinkPrefab(prefabId, prefabObjectId);
|
||||
obj->_prefabID = prefabId;
|
||||
obj->_prefabObjectID = prefabObjectId;
|
||||
}
|
||||
}
|
||||
writer.EndArray();
|
||||
}
|
||||
@@ -406,7 +428,6 @@ bool PrefabManager::CreatePrefab(Actor* targetActor, const StringView& outputPat
|
||||
{
|
||||
SceneObject* obj = sceneObjects->At(i);
|
||||
Guid prefabObjectId;
|
||||
|
||||
if (objectInstanceIdToPrefabObjectId.TryGet(obj->GetSceneObjectId(), prefabObjectId))
|
||||
{
|
||||
obj->LinkPrefab(assetInfo.ID, prefabObjectId);
|
||||
|
||||
Reference in New Issue
Block a user