rj-action-library/Runtime/Viewports/CopyViewportSize.cs

31 lines
466 B
C#
Raw Normal View History

2025-04-01 12:06:15 +00:00
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class CopyViewportSize:Action
{
[Export]
public SubViewport target;
protected override void _OnTrigger()
{
var size = DisplayServer.WindowGetSize();
if ( target.Size == size )
{
return;
}
target.Size = size;
}
}
}