Files
sbox-public/engine/Sandbox.Engine/Scene/Components/MissingComponent.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

27 lines
567 B
C#

using System.Text.Json.Nodes;
namespace Sandbox;
/// <summary>
/// This is added when a component is missing. It will store the json data of the missing component, so we don't lose any data.
/// </summary>
[Expose, Hide]
public class MissingComponent : Component
{
string json { get; }
public MissingComponent( JsonObject jso )
{
json = jso.ToJsonString();
Flags |= ComponentFlags.Error;
}
/// <summary>
/// Get the Json data that was deserialized
/// </summary>
public JsonObject GetJson()
{
return JsonObject.Parse( json ) as JsonObject;
}
}