mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-02 00:38:31 -04:00
* Added ability to bake envmap textures * Added Scene.Editor.GetSceneFolder() - allows saving baked resources for scene * Envmaps are represented with a shiny sphere now instead of a handle * Fixed Enum Dropdown being the wrong color * Added [EnumButtonGroup] * Added GroupButtonControlWidget * Added Editor.EditorSystem (accessible via Application.Editor) * Can place [Menu] attributes in game code (was previously in tools only) * Added "Scene/Bake Envmaps" option
23 lines
519 B
C#
23 lines
519 B
C#
using System.Text.Json.Nodes;
|
|
|
|
namespace Sandbox;
|
|
|
|
public partial class EnvmapProbe
|
|
{
|
|
public override int ComponentVersion => 1;
|
|
|
|
/// <summary>
|
|
/// v1
|
|
/// - Changed RenderDynamically bool to Mode enum.
|
|
/// </summary>
|
|
[Expose, JsonUpgrader( typeof( EnvmapProbe ), 1 )]
|
|
static void Upgrader_v1( JsonObject obj )
|
|
{
|
|
if ( obj.TryGetPropertyValue( "RenderDynamically", out var renderDynamically ) )
|
|
{
|
|
var isDynamic = (bool)renderDynamically;
|
|
obj["Mode"] = isDynamic ? "Realtime" : "CustomTexture";
|
|
}
|
|
}
|
|
}
|